Skip to content

Commit

Permalink
fix: code and style
Browse files Browse the repository at this point in the history
Signed-off-by: Wolfgang <[email protected]>
  • Loading branch information
wofferl committed Oct 17, 2024
1 parent 6a8f12b commit e6ed728
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
3 changes: 2 additions & 1 deletion src/components/modals/HelpModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@
</template>

<script>
import { NcModal, Tooltip } from '@nextcloud/vue'
import NcModal from '@nextcloud/vue/dist/Components/NcModal.js'
import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip.js'

export default {
name: 'HelpModal',
Expand Down
2 changes: 1 addition & 1 deletion src/dataservices/item.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _ from 'lodash'
import { AxiosResponse } from 'axios'
import axios from '@nextcloud/axios'
import store from './../store/app.ts'
import store from './../store/app'

import { API_ROUTES } from '../types/ApiRoutes'
import { FeedItem } from '../types/FeedItem'
Expand Down
25 changes: 15 additions & 10 deletions src/store/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,20 @@ export const APPLICATION_ACTION_TYPES = {

export type AppInfoState = {
error?: Error;
compact: boolean;
compactExpand: boolean;
oldestFirst: boolean;
preventReadOnScroll: boolean;
showAll: boolean;
}

const state: AppInfoState = {
error: undefined,
compact: loadState('news', 'compact') === '1',
compactExpand: loadState('news', 'compactExpand') === '1',
oldestFirst: loadState('news', 'oldestFirst') === '1',
preventReadOnScroll: loadState('news', 'preventReadOnScroll') === '1',
showAll: loadState('news', 'showAll') === '1',
compact: loadState('news', 'compact', null) === '1',
compactExpand: loadState('news', 'compactExpand', null) === '1',
oldestFirst: loadState('news', 'oldestFirst', null) === '1',
preventReadOnScroll: loadState('news', 'preventReadOnScroll', null) === '1',
showAll: loadState('news', 'showAll', null) === '1',
}

const getters = {
Expand Down Expand Up @@ -54,31 +59,31 @@ export const mutations = {
},
compact(
state: AppInfoState,
{ value }: { value: newValue },
{ value }: { value: boolean },
) {
state.compact = value
},
compactExpand(
state: AppInfoState,
{ value }: { value: newValue },
{ value }: { value: boolean },
) {
state.compactExpand = value
},
oldestFirst(
state: AppInfoState,
{ value }: { value: newValue },
{ value }: { value: boolean },
) {
state.oldestFirst = value
},
preventReadOnScroll(
state: AppInfoState,
{ value }: { value: newValue },
{ value }: { value: boolean },
) {
state.preventReadOnScroll = value
},
showAll(
state: AppInfoState,
{ value }: { value: newValue },
{ value }: { value: boolean },
) {
state.showAll = value
},
Expand Down
6 changes: 3 additions & 3 deletions src/store/item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,11 @@ export const actions = {
{ dispatch }: ActionParams<ItemState>,
{ start }: { start: number } = { start: 0 },
) {
state.allItems.splice(start, state.allItems.length)
state.allItems.splice(start, state.allItems.length - start)
state.allItemsLoaded = {}
state.lastItemLoaded = {}
dispatch(FEED_ITEM_ACTION_TYPES.FETCH_STARRED)
dispatch(FEED_ITEM_ACTION_TYPES.FETCH_ITEMS)
dispatch(FEED_ITEM_ACTION_TYPES.FETCH_STARRED, 0)
dispatch(FEED_ITEM_ACTION_TYPES.FETCH_ITEMS, 0)
},
}

Expand Down

0 comments on commit e6ed728

Please sign in to comment.