This commit is contained in:
syuilo
2025-03-10 11:21:17 +09:00
parent 05078e9c14
commit 9842eb2eeb
8 changed files with 9 additions and 9 deletions

View File

@@ -270,8 +270,8 @@ const canPost = computed((): boolean => {
(!poll.value || poll.value.choices.length >= 2); (!poll.value || poll.value.choices.length >= 2);
}); });
const withHashtags = computed(store.makeGetterSetter('postFormWithHashtags')); const withHashtags = store.model('postFormWithHashtags');
const hashtags = computed(store.makeGetterSetter('postFormHashtags')); const hashtags = store.model('postFormHashtags');
watch(text, () => { watch(text, () => {
checkMissingMention(); checkMissingMention();

View File

@@ -67,7 +67,7 @@ const items = ref(prefer.s.menu.map(x => ({
type: x, type: x,
}))); })));
const menuDisplay = computed(store.makeGetterSetter('menuDisplay')); const menuDisplay = store.model('menuDisplay');
async function addItem() { async function addItem() {
const menu = Object.keys(navbarItemDef).filter(k => !prefer.s.menu.includes(k)); const menu = Object.keys(navbarItemDef).filter(k => !prefer.s.menu.includes(k));

View File

@@ -131,7 +131,7 @@ const reportError = prefer.model('reportError');
const enableCondensedLine = prefer.model('enableCondensedLine'); const enableCondensedLine = prefer.model('enableCondensedLine');
const skipNoteRender = prefer.model('skipNoteRender'); const skipNoteRender = prefer.model('skipNoteRender');
const devMode = prefer.model('devMode'); const devMode = prefer.model('devMode');
const defaultWithReplies = computed(store.makeGetterSetter('defaultWithReplies')); const defaultWithReplies = store.model('defaultWithReplies');
watch(skipNoteRender, async () => { watch(skipNoteRender, async () => {
await reloadAsk({ reason: i18n.ts.reloadToApplySetting, unison: true }); await reloadAsk({ reason: i18n.ts.reloadToApplySetting, unison: true });

View File

@@ -177,7 +177,7 @@ const $i = signinRequired();
const Sortable = defineAsyncComponent(() => import('vuedraggable').then(x => x.default)); const Sortable = defineAsyncComponent(() => import('vuedraggable').then(x => x.default));
const reactionAcceptance = computed(store.makeGetterSetter('reactionAcceptance')); const reactionAcceptance = store.model('reactionAcceptance');
function assertVaildLang(lang: string | null): lang is keyof typeof langmap { function assertVaildLang(lang: string | null): lang is keyof typeof langmap {
return lang != null && lang in langmap; return lang != null && lang in langmap;

View File

@@ -196,7 +196,7 @@ const lightThemeId = computed({
}, },
}); });
const darkMode = computed(store.makeGetterSetter('darkMode')); const darkMode = store.model('darkMode');
const syncDeviceDarkMode = prefer.model('syncDeviceDarkMode'); const syncDeviceDarkMode = prefer.model('syncDeviceDarkMode');
const wallpaper = ref(miLocalStorage.getItem('wallpaper')); const wallpaper = ref(miLocalStorage.getItem('wallpaper'));
const themesCount = installedThemes.value.length; const themesCount = installedThemes.value.length;

View File

@@ -752,7 +752,7 @@ export class ColdDeviceStorage {
* 特定のキーの、簡易的なgetter/setterを作ります * 特定のキーの、簡易的なgetter/setterを作ります
* 主にvue場で設定コントロールのmodelとして使う用 * 主にvue場で設定コントロールのmodelとして使う用
*/ */
public static makeGetterSetter<K extends keyof typeof ColdDeviceStorage.default>(key: K) { public static model<K extends keyof typeof ColdDeviceStorage.default>(key: K) {
// TODO: VueのcustomRef使うと良い感じになるかも // TODO: VueのcustomRef使うと良い感じになるかも
const valueRef = ColdDeviceStorage.ref(key); const valueRef = ColdDeviceStorage.ref(key);
return { return {

View File

@@ -62,7 +62,7 @@ const WINDOW_THRESHOLD = 1400;
const settingsWindowed = ref(window.innerWidth > WINDOW_THRESHOLD); const settingsWindowed = ref(window.innerWidth > WINDOW_THRESHOLD);
const menu = ref(prefer.s.menu); const menu = ref(prefer.s.menu);
// const menuDisplay = computed(store.makeGetterSetter('menuDisplay')); // const menuDisplay = store.model('menuDisplay');
const otherNavItemIndicated = computed<boolean>(() => { const otherNavItemIndicated = computed<boolean>(() => {
for (const def in navbarItemDef) { for (const def in navbarItemDef) {
if (menu.value.includes(def)) continue; if (menu.value.includes(def)) continue;

View File

@@ -67,7 +67,7 @@ import { prefer } from '@/preferences.js';
const WINDOW_THRESHOLD = 1400; const WINDOW_THRESHOLD = 1400;
const menu = ref(prefer.s.menu); const menu = ref(prefer.s.menu);
const menuDisplay = computed(store.makeGetterSetter('menuDisplay')); const menuDisplay = store.model('menuDisplay');
const otherNavItemIndicated = computed<boolean>(() => { const otherNavItemIndicated = computed<boolean>(() => {
for (const def in navbarItemDef) { for (const def in navbarItemDef) {
if (menu.value.includes(def)) continue; if (menu.value.includes(def)) continue;