diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2024-01-05 12:33:47 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2024-01-05 12:33:47 +0900 |
| commit | 2cd32b2248c6c2e4495ce67e30257f6b5b41633f (patch) | |
| tree | 4bcb0fc1323f389ad5d4a93619a155b2e6cd6798 /packages/frontend/src | |
| parent | refactor(frontend): os.tsに引き込んだscripts/api.tsの再exportをや... (diff) | |
| download | misskey-2cd32b2248c6c2e4495ce67e30257f6b5b41633f.tar.gz misskey-2cd32b2248c6c2e4495ce67e30257f6b5b41633f.tar.bz2 misskey-2cd32b2248c6c2e4495ce67e30257f6b5b41633f.zip | |
refactor(frontend): reduce type errors
Diffstat (limited to 'packages/frontend/src')
| -rw-r--r-- | packages/frontend/src/pages/settings/profile.vue | 4 | ||||
| -rw-r--r-- | packages/frontend/src/pizzax.ts | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/packages/frontend/src/pages/settings/profile.vue b/packages/frontend/src/pages/settings/profile.vue index 57d84b9619..e2d98cbf29 100644 --- a/packages/frontend/src/pages/settings/profile.vue +++ b/packages/frontend/src/pages/settings/profile.vue @@ -140,8 +140,8 @@ const profile = reactive({ location: $i.location, birthday: $i.birthday, lang: $i.lang, - isBot: $i.isBot, - isCat: $i.isCat, + isBot: $i.isBot ?? false, + isCat: $i.isCat ?? false, }); watch(() => profile, () => { diff --git a/packages/frontend/src/pizzax.ts b/packages/frontend/src/pizzax.ts index c6fa89ea5b..8723110b08 100644 --- a/packages/frontend/src/pizzax.ts +++ b/packages/frontend/src/pizzax.ts @@ -225,7 +225,10 @@ export class Storage<T extends StateDef> { * 特定のキーの、簡易的なgetter/setterを作ります * 主にvue場で設定コントロールのmodelとして使う用 */ - public makeGetterSetter<K extends keyof T>(key: K, getter?: (v: T[K]) => unknown, setter?: (v: unknown) => T[K]) { + public makeGetterSetter<K extends keyof T>(key: K, getter?: (v: T[K]) => unknown, setter?: (v: unknown) => T[K]): { + get: () => T[K]['default']; + set: (value: T[K]['default']) => void; + } { const valueRef = ref(this.state[key]); const stop = watch(this.reactiveState[key], val => { |