ChatUIで選択したタイムラインを記憶するように
This commit is contained in:
parent
7eb6038f92
commit
53c7077d1d
|
@ -150,6 +150,7 @@ import { router } from '@/router';
|
||||||
import { sidebarDef } from '@/sidebar';
|
import { sidebarDef } from '@/sidebar';
|
||||||
import { search } from '@/scripts/search';
|
import { search } from '@/scripts/search';
|
||||||
import copyToClipboard from '@/scripts/copy-to-clipboard';
|
import copyToClipboard from '@/scripts/copy-to-clipboard';
|
||||||
|
import { store } from './store';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
|
@ -189,7 +190,7 @@ export default defineComponent({
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tl: 'home',
|
tl: store.state.tl,
|
||||||
lists: null,
|
lists: null,
|
||||||
antennas: null,
|
antennas: null,
|
||||||
followedChannels: null,
|
followedChannels: null,
|
||||||
|
@ -236,6 +237,7 @@ export default defineComponent({
|
||||||
this.currentChannel = channel;
|
this.currentChannel = channel;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
store.set('tl', this.tl);
|
||||||
}, { immediate: true });
|
}, { immediate: true });
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -10,4 +10,8 @@ export const store = markRaw(new Storage('chatUi', {
|
||||||
data: Record<string, any>;
|
data: Record<string, any>;
|
||||||
}[]
|
}[]
|
||||||
},
|
},
|
||||||
|
tl: {
|
||||||
|
where: 'deviceAccount',
|
||||||
|
default: 'home'
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, defineAsyncComponent } from 'vue';
|
import { defineComponent, defineAsyncComponent } from 'vue';
|
||||||
import XWidgets from '@/components/widgets.vue';
|
import XWidgets from '@/components/widgets.vue';
|
||||||
import { store } from './store.ts';
|
import { store } from './store';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
|
@ -34,6 +34,7 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
updateWidget({ id, data }) {
|
updateWidget({ id, data }) {
|
||||||
|
// TODO: throttleしたい
|
||||||
store.set('widgets', store.state.widgets.map(w => w.id === id ? {
|
store.set('widgets', store.state.widgets.map(w => w.id === id ? {
|
||||||
...w,
|
...w,
|
||||||
data: data
|
data: data
|
||||||
|
|
Loading…
Reference in New Issue