summaryrefslogtreecommitdiff
path: root/packages/frontend/src/preferences/utility.ts
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-03-12 11:39:05 +0900
committersyuilo <4439005+syuilo@users.noreply.github.com>2025-03-12 11:39:05 +0900
commitb03bcf26cd89183c86dea73dc8ef30ae68fe2eb2 (patch)
tree28d7d62d7d2f19d723b70d70ca9ea39c281eb75c /packages/frontend/src/preferences/utility.ts
parentchore(frontend): tweak settings page (diff)
downloadsharkey-b03bcf26cd89183c86dea73dc8ef30ae68fe2eb2.tar.gz
sharkey-b03bcf26cd89183c86dea73dc8ef30ae68fe2eb2.tar.bz2
sharkey-b03bcf26cd89183c86dea73dc8ef30ae68fe2eb2.zip
enhance(frontend): 設定値の同期を実装(実験的)
Diffstat (limited to 'packages/frontend/src/preferences/utility.ts')
-rw-r--r--packages/frontend/src/preferences/utility.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/packages/frontend/src/preferences/utility.ts b/packages/frontend/src/preferences/utility.ts
index 64b2bde4de..fc6eff5f49 100644
--- a/packages/frontend/src/preferences/utility.ts
+++ b/packages/frontend/src/preferences/utility.ts
@@ -9,7 +9,7 @@ import type { MenuItem } from '@/types/menu.js';
import { copyToClipboard } from '@/utility/copy-to-clipboard.js';
import { i18n } from '@/i18n.js';
import { miLocalStorage } from '@/local-storage.js';
-import { prefer, profileManager } from '@/preferences.js';
+import { prefer } from '@/preferences.js';
import * as os from '@/os.js';
import { store } from '@/store.js';
import { $i } from '@/account.js';
@@ -17,7 +17,7 @@ import { misskeyApi } from '@/utility/misskey-api.js';
import { unisonReload } from '@/utility/unison-reload.js';
function canAutoBackup() {
- return profileManager.profile.name != null && profileManager.profile.name.trim() !== '';
+ return prefer.profile.name != null && prefer.profile.name.trim() !== '';
}
export function getPreferencesProfileMenu(): MenuItem[] {
@@ -42,7 +42,7 @@ export function getPreferencesProfileMenu(): MenuItem[] {
const menu: MenuItem[] = [{
type: 'label',
- text: profileManager.profile.name || `(${i18n.ts.noName})`,
+ text: prefer.profile.name || `(${i18n.ts.noName})`,
}, {
text: i18n.ts.rename,
icon: 'ti ti-pencil',
@@ -83,7 +83,7 @@ export function getPreferencesProfileMenu(): MenuItem[] {
text: 'Copy profile as text',
icon: 'ti ti-clipboard',
action: () => {
- copyToClipboard(JSON.stringify(profileManager.profile, null, '\t'));
+ copyToClipboard(JSON.stringify(prefer.profile, null, '\t'));
},
});
}
@@ -95,16 +95,16 @@ async function renameProfile() {
const { canceled, result: name } = await os.inputText({
title: i18n.ts._preferencesProfile.profileName,
text: i18n.ts._preferencesProfile.profileNameDescription + '\n' + i18n.ts._preferencesProfile.profileNameDescription2,
- placeholder: profileManager.profile.name || null,
- default: profileManager.profile.name || null,
+ placeholder: prefer.profile.name || null,
+ default: prefer.profile.name || null,
});
if (canceled || name == null || name.trim() === '') return;
- profileManager.renameProfile(name);
+ prefer.renameProfile(name);
}
function exportCurrentProfile() {
- const p = profileManager.profile;
+ const p = prefer.profile;
const txtBlob = new Blob([JSON.stringify(p)], { type: 'text/plain' });
const dummya = document.createElement('a');
dummya.href = URL.createObjectURL(txtBlob);
@@ -140,8 +140,8 @@ export async function cloudBackup() {
await misskeyApi('i/registry/set', {
scope: ['client', 'preferences', 'backups'],
- key: profileManager.profile.name,
- value: profileManager.profile,
+ key: prefer.profile.name,
+ value: prefer.profile,
});
}