-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ivan Kudinov
committed
Sep 2, 2024
1 parent
7b8019b
commit e13623e
Showing
8 changed files
with
67 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React, { FC } from 'react' | ||
import { useStore } from '../../hooks/useStore' | ||
import { observer } from 'mobx-react' | ||
import FeatureHeader from '../../components/FeatureHeader' | ||
import Button from '../../components/Button' | ||
import FeaturePage from '../../components/FeaturePage' | ||
|
||
const CleanCachePage: FC = () => { | ||
const { cleanCacheStore: store } = useStore() | ||
|
||
const handleSubmit = () => { | ||
store.cleanCache() | ||
} | ||
|
||
return ( | ||
<FeaturePage> | ||
<FeatureHeader name="Очистка кеша статики" /> | ||
<Button onClick={handleSubmit} id="submit" title="Очистить" /> | ||
</FeaturePage> | ||
) | ||
} | ||
|
||
export default observer(CleanCachePage) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import * as SDK from '@expressms/smartapp-sdk' | ||
import { RootStore } from '../../store/rootStore' | ||
import { STATUS } from '@expressms/smartapp-sdk/build/main/types' | ||
import { makeAutoObservable } from 'mobx' | ||
|
||
export class CleanCacheStore { | ||
rootStore: RootStore | ||
response: object | null | ||
|
||
constructor(rootStore: RootStore) { | ||
makeAutoObservable(this) | ||
|
||
this.rootStore = rootStore | ||
this.response = null | ||
} | ||
|
||
async cleanCache(): Promise<void> { | ||
try { | ||
const response = await SDK.cleanCache() | ||
|
||
if (response.payload.status === STATUS.ERROR) { | ||
this.rootStore.toastStore.showToast(`Ошибка очистки кеша ${response.payload.errorCode}`) | ||
} | ||
} catch (e) { | ||
this.rootStore.toastStore.showToast(`Ошибка очистки кеша ${e?.message}`) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1160,10 +1160,10 @@ | |
lodash-es "^4.17.21" | ||
uuid "^8.3.2" | ||
|
||
"@expressms/[email protected].1": | ||
version "1.10.0-alpha.1" | ||
resolved "https://registry.yarnpkg.com/@expressms/smartapp-sdk/-/smartapp-sdk-1.10.0-alpha.1.tgz#b4eba2a5b68529a0c64b106839543a40a6282007" | ||
integrity sha512-ykvx75XDGJKxodEezO+3iJTJy8EE0fzehKRx7DY8geg3J8Mr9OdZCTk52X0phgMw08F4jCogsU1UVQzYdYvUrQ== | ||
"@expressms/[email protected].2": | ||
version "1.10.0-alpha.2" | ||
resolved "https://registry.yarnpkg.com/@expressms/smartapp-sdk/-/smartapp-sdk-1.10.0-alpha.2.tgz#2ca8ba6b66bfedbfb1d2af354dca6a9bc907438e" | ||
integrity sha512-dZyzPSTpOEOJxm+0Vagh5L1V7pTI6Oua9SmL4gD0yERp9sYOOuq0tziJSGhqksIzO1TrRqUg6eZ8d/cgxNQYcw== | ||
dependencies: | ||
"@expressms/smartapp-bridge" "1.4.0-alpha.1" | ||
|
||
|