1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-06-09 10:14:01 +02:00
This commit is contained in:
syuilo
2025-03-10 11:23:15 +09:00
parent 9842eb2eeb
commit cef7575b76
34 changed files with 176 additions and 176 deletions

View File

@@ -128,7 +128,7 @@ watch(store.r.menuDisplay, () => {
});
function toggleIconOnly() {
store.set('menuDisplay', iconOnly.value ? 'sideFull' : 'sideIcon');
store.commit('menuDisplay', iconOnly.value ? 'sideFull' : 'sideIcon');
}
function openAccountMenu(ev: MouseEvent) {

View File

@@ -144,7 +144,7 @@ if (window.innerWidth < 1024) {
document.documentElement.style.overflowY = 'scroll';
if (prefer.s.widgets.length === 0) {
prefer.set('widgets', [{
prefer.commit('widgets', [{
name: 'calendar',
id: 'a', place: null, data: {},
}, {

View File

@@ -222,7 +222,7 @@ function changeProfile(ev: MouseEvent) {
items.push(...(profiles.filter(k => k !== store.s['deck.profile']).map(k => ({
text: k,
action: () => {
store.set('deck.profile', k);
store.commit('deck.profile', k);
unisonReload();
},
}))), { type: 'divider' as const }, {
@@ -237,7 +237,7 @@ function changeProfile(ev: MouseEvent) {
if (canceled || name == null) return;
os.promiseDialog((async () => {
await store.set('deck.profile', name);
await store.commit('deck.profile', name);
await forceSaveDeck();
})(), () => {
unisonReload();
@@ -258,13 +258,13 @@ async function deleteProfile() {
os.promiseDialog((async () => {
if (store.s['deck.profile'] === 'default') {
await store.set('deck.columns', []);
await store.set('deck.layout', []);
await store.commit('deck.columns', []);
await store.commit('deck.layout', []);
await forceSaveDeck();
} else {
await deleteProfile_(store.s['deck.profile']);
}
await store.set('deck.profile', 'default');
await store.commit('deck.profile', 'default');
})(), () => {
unisonReload();
});

View File

@@ -178,7 +178,7 @@ if (window.innerWidth > 1024) {
}
if (prefer.s.widgets.length === 0) {
prefer.set('widgets', [{
prefer.commit('widgets', [{
name: 'calendar',
id: 'a', place: 'right', data: {},
}, {

View File

@@ -37,18 +37,18 @@ const widgets = computed(() => {
});
function addWidget(widget) {
prefer.set('widgets', [{
prefer.commit('widgets', [{
...widget,
place: props.place,
}, ...prefer.s.widgets]);
}
function removeWidget(widget) {
prefer.set('widgets', prefer.s.widgets.filter(w => w.id !== widget.id));
prefer.commit('widgets', prefer.s.widgets.filter(w => w.id !== widget.id));
}
function updateWidget({ id, data }) {
prefer.set('widgets', prefer.s.widgets.map(w => w.id === id ? {
prefer.commit('widgets', prefer.s.widgets.map(w => w.id === id ? {
...w,
data,
place: props.place,
@@ -57,17 +57,17 @@ function updateWidget({ id, data }) {
function updateWidgets(thisWidgets) {
if (props.place === null) {
prefer.set('widgets', thisWidgets);
prefer.commit('widgets', thisWidgets);
return;
}
if (props.place === 'left') {
prefer.set('widgets', [
prefer.commit('widgets', [
...thisWidgets.map(w => ({ ...w, place: 'left' })),
...prefer.s.widgets.filter(w => w.place !== 'left' && !thisWidgets.some(t => w.id === t.id)),
]);
return;
}
prefer.set('widgets', [
prefer.commit('widgets', [
...prefer.s.widgets.filter(w => w.place === 'left' && !thisWidgets.some(t => w.id === t.id)),
...thisWidgets.map(w => ({ ...w, place: 'right' })),
]);