Default to channel id
This commit is contained in:
parent
a1a63f2c35
commit
3b8126781d
|
@ -11,10 +11,11 @@
|
|||
import Kvp from './kvp';
|
||||
|
||||
export default class SecureKvpSetting extends Kvp {
|
||||
|
||||
/**
|
||||
* The value to use when the setting doesn't have a value.
|
||||
*/
|
||||
get defaultValue() {
|
||||
return { key: 'Key', value: '**********' };
|
||||
return { key: 'PlaceholderKey', value: '' };
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
<script>
|
||||
import aes256 from 'aes256';
|
||||
import { DiscordApi } from 'modules';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -52,6 +54,10 @@
|
|||
if (e.key !== 'Enter') return;
|
||||
e.target.blur();
|
||||
}
|
||||
},
|
||||
beforeMount() {
|
||||
if (this.setting.value.key !== 'PlaceholderKey') return;
|
||||
this.setting.value.key = DiscordApi.currentChannel.id || 'Key';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue