Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc-auto-import.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"ComponentPublicInstance": true,
"ComputedRef": true,
"DEFAULT_USER": true,
"DashboardState": true,
"DirectiveBinding": true,
"DownloadsState": true,
"EffectScope": true,
Expand Down
17 changes: 17 additions & 0 deletions src/stores/migrations.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { VOneSuit } from './settings'
import type { DataTableSortItem } from 'vuetify'

export type OldRootState = {
v: 2 | 3 | 4 | 5
Expand Down Expand Up @@ -100,10 +101,18 @@ export interface RootState {
ecosystem: {
bin: {
wordWrap: boolean
dashboard?: DashboardState
}
play: {
showErrors: boolean
wordWrap: boolean
dashboard?: DashboardState
}
studio?: {
dashboard?: DashboardState
}
link?: {
dashboard?: DashboardState
}
docs: {
api: 'link-only' | 'inline'
Expand Down Expand Up @@ -153,6 +162,12 @@ export interface RootState {
}
}

export interface DashboardState {
[key: string]: any
sortBy: DataTableSortItem[]
itemsPerPage: number
}

const migrations = [
(d: any) => {
if (!d.v) {
Expand Down Expand Up @@ -231,6 +246,8 @@ function migrateV5ToV6 (v5Data: any): RootState {
showErrors: true,
wordWrap: false,
},
studio: {},
link: {},
docs: {
api: v5Data.api || 'link-only',
composition: v5Data.composition || 'composition',
Expand Down
6 changes: 3 additions & 3 deletions src/stores/one.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface Invoice {
}

interface OneState {
info: Ref<Info | undefined>
info: Ref<Info | null>
interval: ComputedRef<SubscriptionItemPlan['interval'] | undefined>
subscriptionType: ComputedRef<SubscriptionItemPlan['type'] | undefined>
access: Ref<string[]>
Expand Down Expand Up @@ -73,8 +73,8 @@ export const useOneStore = defineStore('one', (): OneState => {

const isLoading = shallowRef(false)
const isOpen = shallowRef(false)
const info = ref<Info | null>()
const invoices = ref<Invoice[]| null>([])
const info = ref<Info | null>(null)
const invoices = ref<Invoice[]>([])
const sessionId = computed(() => query.value.session_id)
const interval = computed(() => info.value?.items[0].plan.interval)
const subscriptionType = computed(() => info.value?.items[0].plan.type)
Expand Down
2 changes: 2 additions & 0 deletions src/stores/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export const DEFAULT_USER: RootState = {
showErrors: true,
wordWrap: false,
},
studio: {},
link: {},
docs: {
api: 'link-only',
composition: 'composition',
Expand Down