2019-06-21 06:08:17 +00:00
|
|
|
import Vue from 'vue';
|
2018-04-29 08:17:15 +00:00
|
|
|
import Vuex from 'vuex';
|
2018-05-20 17:13:39 +00:00
|
|
|
import createPersistedState from 'vuex-persistedstate';
|
2018-08-22 00:10:39 +00:00
|
|
|
import * as nestedProperty from 'nested-property';
|
2018-05-20 17:13:39 +00:00
|
|
|
|
2018-04-29 12:37:51 +00:00
|
|
|
import MiOS from './mios';
|
2018-09-06 15:02:55 +00:00
|
|
|
import { erase } from '../../prelude/array';
|
2018-10-19 05:34:51 +00:00
|
|
|
import getNoteSummary from '../../misc/get-note-summary';
|
2018-04-29 08:17:15 +00:00
|
|
|
|
|
|
|
const defaultSettings = {
|
2019-01-23 11:43:06 +00:00
|
|
|
keepCw: false,
|
2018-09-17 00:00:20 +00:00
|
|
|
tagTimelines: [],
|
2018-04-29 08:17:15 +00:00
|
|
|
fetchOnScroll: true,
|
2018-11-16 14:13:37 +00:00
|
|
|
remainDeletedNote: false,
|
2018-04-29 08:17:15 +00:00
|
|
|
showPostFormOnTopOfTl: false,
|
2018-08-16 21:03:03 +00:00
|
|
|
suggestRecentHashtags: true,
|
2018-08-28 22:10:42 +00:00
|
|
|
showClockOnHeader: true,
|
2018-04-29 08:17:15 +00:00
|
|
|
circleIcons: true,
|
2018-09-06 20:45:13 +00:00
|
|
|
contrastedAcct: true,
|
2018-09-14 11:33:27 +00:00
|
|
|
showFullAcct: false,
|
2018-11-09 12:10:21 +00:00
|
|
|
showVia: true,
|
2018-04-29 08:17:15 +00:00
|
|
|
showReplyTarget: true,
|
|
|
|
showMyRenotes: true,
|
2018-05-25 11:19:14 +00:00
|
|
|
showRenotedMyNotes: true,
|
2018-08-16 14:59:22 +00:00
|
|
|
showLocalRenotes: true,
|
2018-05-25 11:19:14 +00:00
|
|
|
loadRemoteMedia: true,
|
2018-05-27 13:39:20 +00:00
|
|
|
disableViaMobile: false,
|
2018-06-18 08:25:20 +00:00
|
|
|
memo: null,
|
2018-06-23 07:55:52 +00:00
|
|
|
iLikeSushi: false,
|
2018-09-07 12:13:15 +00:00
|
|
|
rememberNoteVisibility: false,
|
|
|
|
defaultNoteVisibility: 'public',
|
2019-04-17 05:30:31 +00:00
|
|
|
wallpaper: null,
|
2018-11-29 02:05:17 +00:00
|
|
|
webSearchEngine: 'https://www.google.com/?#q={{query}}',
|
2018-11-11 12:17:51 +00:00
|
|
|
mutedWords: [],
|
2019-06-07 11:34:05 +00:00
|
|
|
gamesReversiShowBoardLabels: false,
|
|
|
|
gamesReversiUseAvatarStones: true,
|
2019-06-12 04:47:58 +00:00
|
|
|
disableAnimatedMfm: false,
|
2019-06-20 16:50:01 +00:00
|
|
|
homeProfiles: {},
|
|
|
|
mobileHomeProfiles: {},
|
2019-06-21 04:06:47 +00:00
|
|
|
deckProfiles: {},
|
2019-07-07 19:17:53 +00:00
|
|
|
uploadFolder: null,
|
2018-04-29 08:17:15 +00:00
|
|
|
};
|
|
|
|
|
2018-05-20 17:13:39 +00:00
|
|
|
const defaultDeviceSettings = {
|
2019-06-21 06:08:17 +00:00
|
|
|
homeProfile: 'Default',
|
|
|
|
mobileHomeProfile: 'Default',
|
|
|
|
deckProfile: 'Default',
|
2019-02-25 10:45:00 +00:00
|
|
|
deckMode: false,
|
|
|
|
deckColumnAlign: 'center',
|
|
|
|
deckColumnWidth: 'normal',
|
2019-02-26 05:28:38 +00:00
|
|
|
useShadow: false,
|
|
|
|
roundedCorners: true,
|
2018-09-16 12:40:48 +00:00
|
|
|
reduceMotion: false,
|
2019-02-26 05:28:38 +00:00
|
|
|
darkmode: true,
|
2019-03-17 11:48:55 +00:00
|
|
|
darkTheme: 'bb5a8287-a072-4b0a-8ae5-ea2a0d33f4f2',
|
2018-09-28 15:01:11 +00:00
|
|
|
lightTheme: 'light',
|
2018-12-30 15:59:13 +00:00
|
|
|
lineWidth: 1,
|
2019-02-28 23:08:08 +00:00
|
|
|
fontSize: 0,
|
2018-09-28 15:01:11 +00:00
|
|
|
themes: [],
|
2018-05-20 17:13:39 +00:00
|
|
|
enableSounds: true,
|
|
|
|
soundVolume: 0.5,
|
2019-02-03 10:33:23 +00:00
|
|
|
mediaVolume: 0.5,
|
2018-05-20 17:13:39 +00:00
|
|
|
lang: null,
|
2019-04-19 02:07:54 +00:00
|
|
|
appTypeForce: 'auto',
|
2018-05-20 17:13:39 +00:00
|
|
|
debug: false,
|
|
|
|
lightmode: false,
|
2018-05-25 11:19:14 +00:00
|
|
|
loadRawImages: false,
|
2018-09-14 06:14:59 +00:00
|
|
|
alwaysShowNsfw: false,
|
2018-09-05 04:47:26 +00:00
|
|
|
postStyle: 'standard',
|
2018-10-14 10:44:30 +00:00
|
|
|
navbar: 'top',
|
2018-10-18 21:18:33 +00:00
|
|
|
mobileNotificationPosition: 'bottom',
|
2019-02-04 18:51:54 +00:00
|
|
|
useOsDefaultEmojis: false,
|
2019-02-24 01:38:53 +00:00
|
|
|
disableShowingAnimatedImages: false,
|
|
|
|
expandUsersPhotos: true,
|
|
|
|
expandUsersActivity: true,
|
2018-05-20 17:13:39 +00:00
|
|
|
};
|
|
|
|
|
2018-04-29 08:17:15 +00:00
|
|
|
export default (os: MiOS) => new Vuex.Store({
|
2018-05-27 04:49:09 +00:00
|
|
|
plugins: [createPersistedState({
|
|
|
|
paths: ['i', 'device', 'settings']
|
2018-05-20 17:13:39 +00:00
|
|
|
})],
|
2018-04-29 08:17:15 +00:00
|
|
|
|
|
|
|
state: {
|
2018-05-27 04:49:09 +00:00
|
|
|
i: null,
|
2018-05-17 14:53:55 +00:00
|
|
|
indicate: false,
|
2018-10-18 21:18:33 +00:00
|
|
|
uiHeaderHeight: 0,
|
2018-10-19 05:34:51 +00:00
|
|
|
behindNotes: []
|
2018-04-29 08:17:15 +00:00
|
|
|
},
|
|
|
|
|
2018-05-27 04:49:09 +00:00
|
|
|
getters: {
|
2019-06-21 06:08:17 +00:00
|
|
|
isSignedIn: state => state.i != null,
|
|
|
|
|
|
|
|
home: state => state.settings.homeProfiles[state.device.homeProfile],
|
|
|
|
|
|
|
|
mobileHome: state => state.settings.mobileHomeProfiles[state.device.mobileHomeProfile],
|
|
|
|
|
|
|
|
deck: state => state.settings.deckProfiles[state.device.deckProfile],
|
2018-05-27 04:49:09 +00:00
|
|
|
},
|
|
|
|
|
2018-04-29 08:17:15 +00:00
|
|
|
mutations: {
|
2018-05-27 04:49:09 +00:00
|
|
|
updateI(state, x) {
|
|
|
|
state.i = x;
|
|
|
|
},
|
|
|
|
|
|
|
|
updateIKeyValue(state, x) {
|
|
|
|
state.i[x.key] = x.value;
|
|
|
|
},
|
|
|
|
|
2018-05-17 14:53:55 +00:00
|
|
|
indicate(state, x) {
|
|
|
|
state.indicate = x;
|
|
|
|
},
|
|
|
|
|
2018-04-29 08:17:15 +00:00
|
|
|
setUiHeaderHeight(state, height) {
|
|
|
|
state.uiHeaderHeight = height;
|
2018-10-18 21:18:33 +00:00
|
|
|
},
|
|
|
|
|
2018-10-19 05:34:51 +00:00
|
|
|
pushBehindNote(state, note) {
|
|
|
|
if (note.userId === state.i.id) return;
|
|
|
|
if (state.behindNotes.some(n => n.id === note.id)) return;
|
|
|
|
state.behindNotes.push(note);
|
|
|
|
document.title = `(${state.behindNotes.length}) ${getNoteSummary(note)}`;
|
|
|
|
},
|
|
|
|
|
|
|
|
clearBehindNotes(state) {
|
|
|
|
state.behindNotes = [];
|
|
|
|
document.title = os.instanceName;
|
2019-06-21 06:08:17 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
setHome(state, data) {
|
|
|
|
Vue.set(state.settings.homeProfiles, state.device.homeProfile, data);
|
|
|
|
os.store.dispatch('settings/updateHomeProfile');
|
|
|
|
},
|
|
|
|
|
2019-06-21 06:11:56 +00:00
|
|
|
setDeck(state, data) {
|
|
|
|
Vue.set(state.settings.deckProfiles, state.device.deckProfile, data);
|
|
|
|
os.store.dispatch('settings/updateDeckProfile');
|
|
|
|
},
|
|
|
|
|
2019-06-21 06:08:17 +00:00
|
|
|
addHomeWidget(state, widget) {
|
|
|
|
state.settings.homeProfiles[state.device.homeProfile].unshift(widget);
|
|
|
|
os.store.dispatch('settings/updateHomeProfile');
|
|
|
|
},
|
|
|
|
|
|
|
|
setMobileHome(state, data) {
|
|
|
|
Vue.set(state.settings.mobileHomeProfiles, state.device.mobileHomeProfile, data);
|
|
|
|
os.store.dispatch('settings/updateMobileHomeProfile');
|
|
|
|
},
|
|
|
|
|
|
|
|
updateWidget(state, x) {
|
|
|
|
let w;
|
|
|
|
|
|
|
|
//#region Desktop home
|
|
|
|
const home = state.settings.homeProfiles[state.device.homeProfile];
|
|
|
|
if (home) {
|
|
|
|
w = home.find(w => w.id == x.id);
|
|
|
|
if (w) {
|
|
|
|
w.data = x.data;
|
|
|
|
os.store.dispatch('settings/updateHomeProfile');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region Mobile home
|
|
|
|
const mobileHome = state.settings.mobileHomeProfiles[state.device.mobileHomeProfile];
|
|
|
|
if (mobileHome) {
|
|
|
|
w = mobileHome.find(w => w.id == x.id);
|
|
|
|
if (w) {
|
|
|
|
w.data = x.data;
|
|
|
|
os.store.dispatch('settings/updateMobileHomeProfile');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//#endregion
|
|
|
|
},
|
|
|
|
|
|
|
|
addMobileHomeWidget(state, widget) {
|
|
|
|
state.settings.mobileHomeProfiles[state.device.mobileHomeProfile].unshift(widget);
|
|
|
|
os.store.dispatch('settings/updateMobileHomeProfile');
|
|
|
|
},
|
|
|
|
|
|
|
|
removeMobileHomeWidget(state, widget) {
|
|
|
|
Vue.set('state.settings.mobileHomeProfiles', state.device.mobileHomeProfile, state.settings.mobileHomeProfiles[state.device.mobileHomeProfile].filter(w => w.id != widget.id));
|
|
|
|
os.store.dispatch('settings/updateMobileHomeProfile');
|
|
|
|
},
|
|
|
|
|
|
|
|
addDeckColumn(state, column) {
|
|
|
|
const deck = state.settings.deckProfiles[state.device.deckProfile];
|
|
|
|
if (column.name == undefined) column.name = null;
|
|
|
|
deck.columns.push(column);
|
|
|
|
deck.layout.push([column.id]);
|
|
|
|
os.store.dispatch('settings/updateDeckProfile');
|
|
|
|
},
|
|
|
|
|
|
|
|
removeDeckColumn(state, id) {
|
|
|
|
const deck = state.settings.deckProfiles[state.device.deckProfile];
|
|
|
|
deck.columns = deck.columns.filter(c => c.id != id);
|
|
|
|
deck.layout = deck.layout.map(ids => erase(id, ids));
|
|
|
|
deck.layout = deck.layout.filter(ids => ids.length > 0);
|
|
|
|
os.store.dispatch('settings/updateDeckProfile');
|
|
|
|
},
|
|
|
|
|
|
|
|
swapDeckColumn(state, x) {
|
|
|
|
const deck = state.settings.deckProfiles[state.device.deckProfile];
|
|
|
|
const a = x.a;
|
|
|
|
const b = x.b;
|
|
|
|
const aX = deck.layout.findIndex(ids => ids.indexOf(a) != -1);
|
|
|
|
const aY = deck.layout[aX].findIndex(id => id == a);
|
|
|
|
const bX = deck.layout.findIndex(ids => ids.indexOf(b) != -1);
|
|
|
|
const bY = deck.layout[bX].findIndex(id => id == b);
|
|
|
|
deck.layout[aX][aY] = b;
|
|
|
|
deck.layout[bX][bY] = a;
|
|
|
|
os.store.dispatch('settings/updateDeckProfile');
|
|
|
|
},
|
|
|
|
|
|
|
|
swapLeftDeckColumn(state, id) {
|
|
|
|
const deck = state.settings.deckProfiles[state.device.deckProfile];
|
|
|
|
deck.layout.some((ids, i) => {
|
|
|
|
if (ids.indexOf(id) != -1) {
|
|
|
|
const left = deck.layout[i - 1];
|
|
|
|
if (left) {
|
|
|
|
// https://vuejs.org/v2/guide/list.html#Caveats
|
|
|
|
//state.deck.layout[i - 1] = state.deck.layout[i];
|
|
|
|
//state.deck.layout[i] = left;
|
|
|
|
deck.layout.splice(i - 1, 1, deck.layout[i]);
|
|
|
|
deck.layout.splice(i, 1, left);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
os.store.dispatch('settings/updateDeckProfile');
|
|
|
|
},
|
|
|
|
|
|
|
|
swapRightDeckColumn(state, id) {
|
|
|
|
const deck = state.settings.deckProfiles[state.device.deckProfile];
|
|
|
|
deck.layout.some((ids, i) => {
|
|
|
|
if (ids.indexOf(id) != -1) {
|
|
|
|
const right = deck.layout[i + 1];
|
|
|
|
if (right) {
|
|
|
|
// https://vuejs.org/v2/guide/list.html#Caveats
|
|
|
|
//state.deck.layout[i + 1] = state.deck.layout[i];
|
|
|
|
//state.deck.layout[i] = right;
|
|
|
|
deck.layout.splice(i + 1, 1, deck.layout[i]);
|
|
|
|
deck.layout.splice(i, 1, right);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
os.store.dispatch('settings/updateDeckProfile');
|
|
|
|
},
|
|
|
|
|
|
|
|
swapUpDeckColumn(state, id) {
|
|
|
|
const deck = state.settings.deckProfiles[state.device.deckProfile];
|
|
|
|
const ids = deck.layout.find(ids => ids.indexOf(id) != -1);
|
|
|
|
ids.some((x, i) => {
|
|
|
|
if (x == id) {
|
|
|
|
const up = ids[i - 1];
|
|
|
|
if (up) {
|
|
|
|
// https://vuejs.org/v2/guide/list.html#Caveats
|
|
|
|
//ids[i - 1] = id;
|
|
|
|
//ids[i] = up;
|
|
|
|
ids.splice(i - 1, 1, id);
|
|
|
|
ids.splice(i, 1, up);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
os.store.dispatch('settings/updateDeckProfile');
|
|
|
|
},
|
|
|
|
|
|
|
|
swapDownDeckColumn(state, id) {
|
|
|
|
const deck = state.settings.deckProfiles[state.device.deckProfile];
|
|
|
|
const ids = deck.layout.find(ids => ids.indexOf(id) != -1);
|
|
|
|
ids.some((x, i) => {
|
|
|
|
if (x == id) {
|
|
|
|
const down = ids[i + 1];
|
|
|
|
if (down) {
|
|
|
|
// https://vuejs.org/v2/guide/list.html#Caveats
|
|
|
|
//ids[i + 1] = id;
|
|
|
|
//ids[i] = down;
|
|
|
|
ids.splice(i + 1, 1, id);
|
|
|
|
ids.splice(i, 1, down);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
os.store.dispatch('settings/updateDeckProfile');
|
|
|
|
},
|
|
|
|
|
|
|
|
stackLeftDeckColumn(state, id) {
|
|
|
|
const deck = state.settings.deckProfiles[state.device.deckProfile];
|
|
|
|
const i = deck.layout.findIndex(ids => ids.indexOf(id) != -1);
|
|
|
|
deck.layout = deck.layout.map(ids => erase(id, ids));
|
|
|
|
const left = deck.layout[i - 1];
|
|
|
|
if (left) deck.layout[i - 1].push(id);
|
|
|
|
deck.layout = deck.layout.filter(ids => ids.length > 0);
|
|
|
|
os.store.dispatch('settings/updateDeckProfile');
|
|
|
|
},
|
|
|
|
|
|
|
|
popRightDeckColumn(state, id) {
|
|
|
|
const deck = state.settings.deckProfiles[state.device.deckProfile];
|
|
|
|
const i = deck.layout.findIndex(ids => ids.indexOf(id) != -1);
|
|
|
|
deck.layout = deck.layout.map(ids => erase(id, ids));
|
|
|
|
deck.layout.splice(i + 1, 0, [id]);
|
|
|
|
deck.layout = deck.layout.filter(ids => ids.length > 0);
|
|
|
|
os.store.dispatch('settings/updateDeckProfile');
|
|
|
|
},
|
|
|
|
|
|
|
|
addDeckWidget(state, x) {
|
|
|
|
const deck = state.settings.deckProfiles[state.device.deckProfile];
|
|
|
|
const column = deck.columns.find(c => c.id == x.id);
|
|
|
|
if (column == null) return;
|
|
|
|
column.widgets.unshift(x.widget);
|
|
|
|
os.store.dispatch('settings/updateDeckProfile');
|
|
|
|
},
|
|
|
|
|
|
|
|
removeDeckWidget(state, x) {
|
|
|
|
const deck = state.settings.deckProfiles[state.device.deckProfile];
|
|
|
|
const column = deck.columns.find(c => c.id == x.id);
|
|
|
|
if (column == null) return;
|
|
|
|
column.widgets = column.widgets.filter(w => w.id != x.widget.id);
|
|
|
|
os.store.dispatch('settings/updateDeckProfile');
|
|
|
|
},
|
|
|
|
|
|
|
|
renameDeckColumn(state, x) {
|
|
|
|
const deck = state.settings.deckProfiles[state.device.deckProfile];
|
|
|
|
const column = deck.columns.find(c => c.id == x.id);
|
|
|
|
if (column == null) return;
|
|
|
|
column.name = x.name;
|
|
|
|
os.store.dispatch('settings/updateDeckProfile');
|
|
|
|
},
|
|
|
|
|
|
|
|
updateDeckColumn(state, x) {
|
|
|
|
const deck = state.settings.deckProfiles[state.device.deckProfile];
|
|
|
|
let column = deck.columns.find(c => c.id == x.id);
|
|
|
|
if (column == null) return;
|
|
|
|
column = x;
|
|
|
|
os.store.dispatch('settings/updateDeckProfile');
|
2018-04-29 08:17:15 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2018-05-27 04:49:09 +00:00
|
|
|
actions: {
|
|
|
|
login(ctx, i) {
|
|
|
|
ctx.commit('updateI', i);
|
2019-04-07 12:50:36 +00:00
|
|
|
ctx.dispatch('settings/merge', i.clientData);
|
2018-05-27 04:49:09 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
logout(ctx) {
|
|
|
|
ctx.commit('updateI', null);
|
2019-05-04 19:04:30 +00:00
|
|
|
document.cookie = `i=; max-age=0; domain=${document.location.hostname}`;
|
2018-11-28 07:19:02 +00:00
|
|
|
localStorage.removeItem('i');
|
2018-05-27 04:49:09 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
mergeMe(ctx, me) {
|
2018-12-11 11:36:55 +00:00
|
|
|
for (const [key, value] of Object.entries(me)) {
|
2018-05-27 04:49:09 +00:00
|
|
|
ctx.commit('updateIKeyValue', { key, value });
|
2018-12-11 11:36:55 +00:00
|
|
|
}
|
2018-05-27 04:49:09 +00:00
|
|
|
|
2019-04-07 12:50:36 +00:00
|
|
|
if (me.clientData) {
|
|
|
|
ctx.dispatch('settings/merge', me.clientData);
|
2018-05-27 04:49:09 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2018-04-29 08:17:15 +00:00
|
|
|
modules: {
|
2018-05-20 17:13:39 +00:00
|
|
|
device: {
|
|
|
|
namespaced: true,
|
|
|
|
|
|
|
|
state: defaultDeviceSettings,
|
|
|
|
|
|
|
|
mutations: {
|
|
|
|
set(state, x: { key: string; value: any }) {
|
|
|
|
state[x.key] = x.value;
|
2018-05-26 15:18:44 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
setTl(state, x) {
|
|
|
|
state.tl = {
|
|
|
|
src: x.src,
|
|
|
|
arg: x.arg
|
|
|
|
};
|
2018-08-17 07:35:04 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
setVisibility(state, visibility) {
|
|
|
|
state.visibility = visibility;
|
2018-06-05 20:18:08 +00:00
|
|
|
},
|
2019-02-25 10:45:00 +00:00
|
|
|
}
|
|
|
|
},
|
2018-04-29 08:17:15 +00:00
|
|
|
|
2019-02-25 10:45:00 +00:00
|
|
|
settings: {
|
|
|
|
namespaced: true,
|
2018-04-29 08:17:15 +00:00
|
|
|
|
2019-02-25 10:45:00 +00:00
|
|
|
state: defaultSettings,
|
2018-06-05 20:18:08 +00:00
|
|
|
|
2019-02-25 10:45:00 +00:00
|
|
|
mutations: {
|
|
|
|
set(state, x: { key: string; value: any }) {
|
|
|
|
nestedProperty.set(state, x.key, x.value);
|
2018-06-06 10:22:45 +00:00
|
|
|
},
|
2019-02-25 10:45:00 +00:00
|
|
|
},
|
2018-06-07 19:21:06 +00:00
|
|
|
|
2019-02-25 10:45:00 +00:00
|
|
|
actions: {
|
|
|
|
merge(ctx, settings) {
|
|
|
|
if (settings == null) return;
|
|
|
|
for (const [key, value] of Object.entries(settings)) {
|
|
|
|
ctx.commit('set', { key, value });
|
|
|
|
}
|
2018-06-06 10:22:45 +00:00
|
|
|
},
|
|
|
|
|
2019-02-25 10:45:00 +00:00
|
|
|
set(ctx, x) {
|
|
|
|
ctx.commit('set', x);
|
2018-06-05 20:18:08 +00:00
|
|
|
|
2019-02-25 10:45:00 +00:00
|
|
|
if (ctx.rootGetters.isSignedIn) {
|
2019-04-18 12:36:44 +00:00
|
|
|
os.api('i/update-client-setting', {
|
2019-02-25 10:45:00 +00:00
|
|
|
name: x.key,
|
|
|
|
value: x.value
|
|
|
|
});
|
|
|
|
}
|
2018-06-06 21:13:57 +00:00
|
|
|
},
|
2019-06-20 16:50:01 +00:00
|
|
|
|
|
|
|
updateHomeProfile(ctx) {
|
|
|
|
const profiles = ctx.state.homeProfiles;
|
|
|
|
ctx.commit('set', {
|
|
|
|
key: 'homeProfiles',
|
|
|
|
value: profiles
|
|
|
|
});
|
|
|
|
os.api('i/update-client-setting', {
|
|
|
|
name: 'homeProfiles',
|
|
|
|
value: profiles
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
updateMobileHomeProfile(ctx) {
|
|
|
|
const profiles = ctx.state.mobileHomeProfiles;
|
|
|
|
ctx.commit('set', {
|
|
|
|
key: 'mobileHomeProfiles',
|
|
|
|
value: profiles
|
|
|
|
});
|
|
|
|
os.api('i/update-client-setting', {
|
|
|
|
name: 'mobileHomeProfiles',
|
|
|
|
value: profiles
|
|
|
|
});
|
2019-06-21 04:06:47 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
updateDeckProfile(ctx) {
|
|
|
|
const profiles = ctx.state.deckProfiles;
|
|
|
|
ctx.commit('set', {
|
|
|
|
key: 'deckProfiles',
|
|
|
|
value: profiles
|
|
|
|
});
|
|
|
|
os.api('i/update-client-setting', {
|
|
|
|
name: 'deckProfiles',
|
|
|
|
value: profiles
|
|
|
|
});
|
|
|
|
},
|
2018-04-29 08:17:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|