diff --git a/components/Alerts/SignFailed.vue b/components/Alerts/SignFailed.vue index af39f2fd..bcd19dc9 100644 --- a/components/Alerts/SignFailed.vue +++ b/components/Alerts/SignFailed.vue @@ -53,7 +53,7 @@ export default class SignFailed extends Vue { get errorAlert() { switch (this.errorType) { case ErrorType.INSUFFICIENT_BALANCE: - return 'IscnRegisterForm.error.insufficient' + return 'IscnRegisterForm.error.insufficient_with_buy' case ErrorType.USER_NOT_ISCN_OWNER: return 'IscnRegisterForm.error.notIscnOwner' diff --git a/components/IscnRegisterForm.vue b/components/IscnRegisterForm.vue index d2203c6b..548cf724 100644 --- a/components/IscnRegisterForm.vue +++ b/components/IscnRegisterForm.vue @@ -894,7 +894,7 @@ export default class IscnRegisterForm extends Vue { get errorMsg() { switch (this.error) { case 'INSUFFICIENT_BALANCE': - return this.$t('IscnRegisterForm.error.insufficient') + return this.$t('IscnRegisterForm.error.insufficient_with_like', { like: this.totalFee }) case 'MISSING_SIGNER': return this.$t('IscnRegisterForm.error.missingSigner') default: diff --git a/components/IscnUploadForm.vue b/components/IscnUploadForm.vue index aa69ba5e..6ba43ab4 100644 --- a/components/IscnUploadForm.vue +++ b/components/IscnUploadForm.vue @@ -387,7 +387,7 @@ export default class IscnUploadForm extends Vue { get errorMsg() { switch (this.error) { case 'INSUFFICIENT_BALANCE': - return this.$t('IscnRegisterForm.error.insufficient') + return this.$t('IscnRegisterForm.error.insufficient_with_like', { like: this.arweaveFee }) case 'MISSING_SIGNER': return this.$t('IscnRegisterForm.error.missingSigner') default: diff --git a/components/RootLayout.vue b/components/RootLayout.vue index 03dcb9b7..e1fb6de8 100644 --- a/components/RootLayout.vue +++ b/components/RootLayout.vue @@ -27,7 +27,6 @@ import { namespace } from 'vuex-class' import { IS_CHAIN_UPGRADING } from '~/constant' const walletModule = namespace('wallet') -const uiModule = namespace('ui') @Component({ head() { @@ -41,15 +40,12 @@ const uiModule = namespace('ui') export default class RootLayout extends Vue { @walletModule.Action('restoreSessionIfNecessary') restoreSessionIfNecessary!: () => Promise - @uiModule.Action('init') initUIStore!: () => void - @Prop({ default: 'bg-light-gray' }) readonly bgClass!: string isOpenChainUpgradeBlockingDialog = false async mounted() { this.isOpenChainUpgradeBlockingDialog = !!IS_CHAIN_UPGRADING - this.initUIStore() await this.restoreSessionIfNecessary() } diff --git a/locales/en.json b/locales/en.json index 3fc93108..00c66481 100644 --- a/locales/en.json +++ b/locales/en.json @@ -203,7 +203,8 @@ "IscnRegisterForm.error.buy": "Buy LikeCoin", "IscnRegisterForm.error.descriptionIsEmpty": "Please enter the ISCN description", "IscnRegisterForm.error.faucet": "Get faucet", - "IscnRegisterForm.error.insufficient": "Oops, Insufficient Balance. {buy} ", + "IscnRegisterForm.error.insufficient_with_buy": "Oops, Insufficient Balance. {buy} ", + "IscnRegisterForm.error.insufficient_with_like": "Oops, Insufficient balance, requires {like} ", "IscnRegisterForm.error.missingSigner": "Missing Signer. Please connect your wallet.", "IscnRegisterForm.error.notIscnOwner": "Oops, User is not the current ISCN owner. {login}", "IscnRegisterForm.error.reLogIn": "Change Wallet", diff --git a/store/ui.ts b/store/ui.ts deleted file mode 100644 index 9fbf211e..00000000 --- a/store/ui.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* eslint-disable import/no-extraneous-dependencies */ -import { Module, VuexModule, Mutation, Action } from 'vuex-module-decorators' - -const CURRENT_VIEW_MODE_KEY = 'CURRENT_VIEW_MODE_KEY'; - -export enum ViewMode { - Desktop = 'desktop', - Mobile = 'mobile' -} - -@Module({ - name: 'ui', - stateFactory: true, - namespaced: true, -}) -export default class UIStore extends VuexModule { - viewMode = ViewMode.Mobile - - get isDesktopViewMode() { - return this.viewMode === ViewMode.Desktop - } - - get isMobileViewMode() { - return this.viewMode === ViewMode.Mobile - } - - @Mutation - setViewMode(mode: ViewMode) { - this.viewMode = mode - } - - @Action - init() { - let mode: any = '' - mode = - window.sessionStorage?.getItem(CURRENT_VIEW_MODE_KEY) === ViewMode.Desktop || - ViewMode.Mobile - ? window.sessionStorage?.getItem(CURRENT_VIEW_MODE_KEY) - : ViewMode.Mobile - this.setViewMode(mode) - } - - @Action - changeViewMode(mode: ViewMode) { - window.sessionStorage?.setItem(CURRENT_VIEW_MODE_KEY, mode) - this.setViewMode(mode) - } - - @Action - enableDesktopViewMode() { - this.changeViewMode(ViewMode.Desktop) - } - - @Action - enableMobileViewMode() { - this.changeViewMode(ViewMode.Mobile) - } -} diff --git a/utils/store-accessor.ts b/utils/store-accessor.ts index e107d322..cb7203ae 100644 --- a/utils/store-accessor.ts +++ b/utils/store-accessor.ts @@ -6,21 +6,17 @@ import { getModule } from 'vuex-module-decorators' import WalletStore from '~/store/wallet' import IscnStore from '~/store/iscn' -import UIStore from '~/store/ui' let walletStore: WalletStore let iscnStore: IscnStore -let uiStore: UIStore function initialiseStores(store: Store): void { walletStore = getModule(WalletStore, store) iscnStore = getModule(IscnStore, store) - uiStore = getModule(UIStore, store) } export { initialiseStores, walletStore, iscnStore, - uiStore, }