Skip to content

Commit

Permalink
fix: remove storage
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamondYuan committed Nov 12, 2024
1 parent 48ca9df commit 5ff64fa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
7 changes: 1 addition & 6 deletions src/containers/apps/Apps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import ErrorRetry from '../global/ErrorRetry'
import { IAppDef } from './AppDefinition'
import AppsTable from './AppsTable'
import CreateNewApp from './CreateNewApp'
import StorageHelper from '../../utils/StorageHelper'

export default class Apps extends ApiComponent<
RouteComponentProps<any>,
Expand All @@ -32,8 +31,7 @@ export default class Apps extends ApiComponent<
this.state = {
isLoading: true,
apiData: undefined,
showCreateAppForm:
StorageHelper.getCreateAppFormVisibilityFromLocalStorage(),
showCreateAppForm: false
}
}

Expand Down Expand Up @@ -156,9 +154,6 @@ export default class Apps extends ApiComponent<
showCreateAppForm:
!self.state.showCreateAppForm,
})
StorageHelper.setCreateAppFormVisibilityInLocalStorage(
!self.state.showCreateAppForm
)
}}
/>
</Col>
Expand Down
13 changes: 0 additions & 13 deletions src/utils/StorageHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const SIDER_COLLAPSED_STATE = 'CAPROVER_SIDER_COLLAPSED_STATE'
const DARK_MODE = 'CAPROVER_DARK_MODE'
const LANGUAGE = 'CAPROVER_LANGUAGE'
const APP_PROJECT_SPLIT_RATIO = 'APP_PROJECT_SPLIT_RATIO'
const SHOW_CREATE_APP_FORM_VISIBLE = 'SHOW_CREATE_APP_FORM_VISIBLE'

class StorageHelper {
getAuthKeyFromStorage() {
Expand Down Expand Up @@ -63,18 +62,6 @@ class StorageHelper {
window.matchMedia('(prefers-color-scheme: dark)').matches
}

setCreateAppFormVisibilityInLocalStorage(isVisible: boolean) {
localStorage.setItem(
SHOW_CREATE_APP_FORM_VISIBLE,
JSON.stringify(isVisible)
)
}

getCreateAppFormVisibilityFromLocalStorage(): boolean {
const isVisible = localStorage.getItem(SHOW_CREATE_APP_FORM_VISIBLE)
return isVisible ? JSON.parse(isVisible) : true
}

setLanguageInLocalStorage(language: string) {
localStorage.setItem(LANGUAGE, language)
}
Expand Down

0 comments on commit 5ff64fa

Please sign in to comment.