Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
brenzi committed Jan 15, 2025
1 parent 130eea0 commit d132023
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 45 deletions.
11 changes: 8 additions & 3 deletions components/overlays/SessionProxiesOverlay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,15 @@ const updateAuthorization = async () => {
selectedSessionProxyRole.value,
);
if (bestSessionProxyRole.value === null) {
if (accountStore.getDecimalBalanceFree(incogniteeSidechain) < INCOGNITEE_SESSION_PROXY_DEPOSIT + INCOGNITEE_TX_FEE) {
alert(
if (
accountStore.getDecimalBalanceFree(incogniteeSidechain) <
INCOGNITEE_SESSION_PROXY_DEPOSIT + INCOGNITEE_TX_FEE
) {
alert(
"Insufficient funds to register session proxy. You need at least " +
formatDecimalBalance(INCOGNITEE_SESSION_PROXY_DEPOSIT + INCOGNITEE_TX_FEE) +
formatDecimalBalance(
INCOGNITEE_SESSION_PROXY_DEPOSIT + INCOGNITEE_TX_FEE,
) +
" " +
accountStore.getSymbol +
" private balance to register a session proxy",
Expand Down
32 changes: 10 additions & 22 deletions components/tabs/TeerDaysTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,7 @@
<dd
class="mt-1 flex items-baseline justify-between md:block lg:flex"
>
<div
v-if="summaryHolders === null"
class="spinner"
></div>
<div v-if="summaryHolders === null" class="spinner"></div>
<div
v-else
class="flex items-baseline text-2xl font-semibold text-incognitee-green"
Expand Down Expand Up @@ -347,10 +344,7 @@
<dd
class="mt-1 flex items-baseline justify-between md:block lg:flex"
>
<div
v-if="summaryTeerBonded === null"
class="spinner"
></div>
<div v-if="summaryTeerBonded === null" class="spinner"></div>
<div
v-else
class="flex items-baseline text-2xl font-semibold text-incognitee-green"
Expand Down Expand Up @@ -380,10 +374,7 @@
<dd
class="mt-1 flex items-baseline justify-between md:block lg:flex"
>
<div
v-if="summaryTeerDays === null"
class="spinner"
></div>
<div v-if="summaryTeerDays === null" class="spinner"></div>
<div
v-else
class="flex items-baseline text-2xl font-semibold text-incognitee-green"
Expand Down Expand Up @@ -656,12 +647,10 @@
</template>

<script setup lang="ts">
import {
web3FromAddress,
} from "@polkadot/extension-dapp";
import { web3FromAddress } from "@polkadot/extension-dapp";
import { ApiPromise, WsProvider } from "@polkadot/api";
import { cryptoWaitReady } from "@polkadot/util-crypto";
import {onMounted, onUnmounted, computed, ref, watch, defineProps} from "vue";
import { onMounted, onUnmounted, computed, ref, watch, defineProps } from "vue";
import { useRouter } from "vue-router";
import { useAccount } from "~/store/account.ts";
import { formatDecimalBalance } from "~/helpers/numbers";
Expand Down Expand Up @@ -704,7 +693,10 @@ watch(
);
const onExtensionAccountChange = async () => {
await dropSubscriptions();
console.log("re-subscribing to TEERday data using account:", accountStore.getAddress);
console.log(
"re-subscribing to TEERday data using account:",
accountStore.getAddress,
);
await subscribeToTeerDayStats();
if (accountStore.getAddress === "none") {
console.log("skipping api init. no address");
Expand All @@ -721,10 +713,7 @@ const onExtensionAccountChange = async () => {
}) => {
console.log("TEER balance:" + currentFree);
accountStore.setBalanceFree(BigInt(currentFree), teerdaysNetwork);
accountStore.setBalanceReserved(
BigInt(currentReserved),
teerdaysNetwork,
);
accountStore.setBalanceReserved(BigInt(currentReserved), teerdaysNetwork);
accountStore.setBalanceFrozen(BigInt(currentFrozen), teerdaysNetwork);
isFetchingTeerBalance.value = false;
},
Expand Down Expand Up @@ -998,7 +987,6 @@ const props = defineProps({
required: true,
},
});
</script>

<style scoped>
Expand Down
4 changes: 2 additions & 2 deletions components/tabs/WalletTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<WarningBanner
v-if="
(accountStore.getSymbol === 'TEER' ||
accountStore.getSymbol === 'DOT') &&
accountStore.getSymbol === 'DOT') &&
accountStore.getAddress !== 'none' &&
!accountStore.hasInjector
"
Expand Down Expand Up @@ -1037,7 +1037,7 @@ import {
INCOGNITEE_SHIELDING_FEE_FRACTION,
INCOGNITEE_TX_FEE,
INCOGNITEE_UNSHIELDING_FEE,
minUnshieldingAmount
minUnshieldingAmount,
} from "~/configs/incognitee";
import { formatDecimalBalance } from "~/helpers/numbers";
import WarningBanner from "~/components/ui/WarningBanner.vue";
Expand Down
4 changes: 2 additions & 2 deletions components/ui/HealthIndicator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ const systemHealth = useSystemHealth();
const router = useRouter();
const contextualHealth = computed(() => {
// case "/teerdays":
// return systemHealth.getIntegriteeSystemHealth.overall();
// case "/teerdays":
// return systemHealth.getIntegriteeSystemHealth.overall();
return systemHealth.getSidechainSystemHealth.overall();
});
Expand Down
8 changes: 7 additions & 1 deletion components/ui/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,13 @@
Messages
</button>
</li>
<li v-if="accountStore.getSymbol === 'TEER' || accountStore.getSymbol === 'DOT'" class="px-4">
<li
v-if="
accountStore.getSymbol === 'TEER' ||
accountStore.getSymbol === 'DOT'
"
class="px-4"
>
<button
class="flex items-center w-full text-left text-sm font-semibold hover:bg-gray-800 px-2 py-2 rounded-md"
@click="
Expand Down
2 changes: 1 addition & 1 deletion configs/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export enum ChainId {
IntegriteeDev,
IncogniteePaseoRelay,
IncogniteeIntegriteeKusama,
IncogniteeAssetHubPolkadot
IncogniteeAssetHubPolkadot,
}

type ChainConfig = {
Expand Down
4 changes: 2 additions & 2 deletions configs/incognitee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const minUnshieldingAmount = (token: string): number => {
return 1.1;
} else if (token === "DOT") {
return 0.1;
} else {
} else {
return 0.1;
}
}
};
29 changes: 22 additions & 7 deletions lib/environmentConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,34 @@ export const loadEnv = async (envFile?: string) => {
return envOverride[key] ?? envDefault[key] ?? defaultValue;
};

const shieldingTargetEnv = getEnvValue("SHIELDING_TARGET", ChainId.PaseoRelay);
const shieldingTargetEnv = getEnvValue(
"SHIELDING_TARGET",
ChainId.PaseoRelay,
);
const shieldingLimitEnv = getEnvValue("SHIELDING_LIMIT", Infinity);
const incogniteeSidechainEnv = getEnvValue("INCOGNITEE_SIDECHAIN", ChainId.IncogniteePaseoRelay);
const incogniteeShardEnv = getEnvValue("SHARD", "5wePd1LYa5M49ghwgZXs55cepKbJKhj5xfzQGfPeMS7c");
const incogniteeSidechainEnv = getEnvValue(
"INCOGNITEE_SIDECHAIN",
ChainId.IncogniteePaseoRelay,
);
const incogniteeShardEnv = getEnvValue(
"SHARD",
"5wePd1LYa5M49ghwgZXs55cepKbJKhj5xfzQGfPeMS7c",
);
const isLiveEnv = getEnvValue("LIVE", true);
const integriteeNetworkEnv = getEnvValue("TEERDAYS_NETWORK", ChainId.IntegriteeKusama);
const integriteeNetworkEnv = getEnvValue(
"TEERDAYS_NETWORK",
ChainId.IntegriteeKusama,
);

incogniteeShard.value = incogniteeShardEnv;
shieldingTarget.value = ChainId[shieldingTargetEnv] ?? ChainId.PaseoRelay;
incogniteeSidechain.value = ChainId[incogniteeSidechainEnv] ?? ChainId.IncogniteePaseoRelay;
shieldingLimit.value = shieldingLimitEnv > 0 ? Number(shieldingLimitEnv) : Infinity;
incogniteeSidechain.value =
ChainId[incogniteeSidechainEnv] ?? ChainId.IncogniteePaseoRelay;
shieldingLimit.value =
shieldingLimitEnv > 0 ? Number(shieldingLimitEnv) : Infinity;
isLive.value = toBoolean(isLiveEnv);
teerdaysNetwork.value = ChainId[integriteeNetworkEnv] ?? ChainId.IntegriteeKusama;
teerdaysNetwork.value =
ChainId[integriteeNetworkEnv] ?? ChainId.IntegriteeKusama;

console.log(
"SHIELDING_TARGET: env:" +
Expand Down
2 changes: 1 addition & 1 deletion lib/wellKnownIdentites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ export const identities = [
{
username: "IncogniteeQuizMaster",
address: "12sJZcxqGkBUN8xesuLxC4hbYk7Y6W6Amkm52onbcxgfvnzA",
}
},
];
3 changes: 2 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export default defineNuxtConfig({
head: {
title: "Incognitee",
charset: "utf-8",
viewport: "width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no",
viewport:
"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no",
meta: [
// {
// hid: 'robots',
Expand Down
2 changes: 1 addition & 1 deletion pages/dot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
</template>

<script setup>
import IndexPage from './index.vue';
import IndexPage from "./index.vue";
</script>
4 changes: 3 additions & 1 deletion pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
<div v-if="activeApp === 'vouchers'"><VouchersTab /></div>
<div v-else-if="activeApp === 'swap'"><SwapTab /></div>
<div v-else-if="activeApp === 'gov'"><GovTab /></div>
<div v-else-if="activeApp === 'teerdays'"><TeerDaysTab :isMobile="isMobile" /></div>
<div v-else-if="activeApp === 'teerdays'">
<TeerDaysTab :isMobile="isMobile" />
</div>
<!-- New Wallet -->
<OverlayDialog
:show="showNewWalletOverlay"
Expand Down
2 changes: 1 addition & 1 deletion pages/teer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
</template>

<script setup>
import IndexPage from './index.vue';
import IndexPage from "./index.vue";
</script>

0 comments on commit d132023

Please sign in to comment.