Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 2ed1ae1

Browse files
committed
RMRK: Fixed extension ss58Format, added missing icons
1 parent 0b8d915 commit 2ed1ae1

File tree

6 files changed

+28
-9
lines changed

6 files changed

+28
-9
lines changed

dashboard/src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default class Dashboard extends Vue {
3030
keyring.loadAll({
3131
ss58Format: this.ss58Format || 42,
3232
type: 'sr25519',
33-
isDevelopment: this.$store.state.development.status || false,
33+
isDevelopment: Boolean(process.env.VUE_APP_KEYRING) || false,
3434
});
3535
}
3636

dashboard/src/components/settings/General.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<SettingChooser label="Default Icon Theme" selector="availableIcons" setter="setIcon" defaultValue="icon" />
66
<SettingChooser label="Interface Operation Mode" selector="availableUiModes" setter="setUiMode" defaultValue="uiMode" />
77
<!-- <SettingChooser label="Interface Operation Mode" selector="availableLocking" setter="setLocking" defaultValue="locking" /> -->
8-
<SettingChooserExplorer label="Default Explorer Provider" selector="provider" setter="setExplorer" defaultValue="0" />
8+
<!-- <SettingChooserExplorer label="Default Explorer Provider" selector="provider" setter="setExplorer" defaultValue="0" />
99
<SettingChooserExplorer label="Default Explorer Chain" selector="chain" setter="setExplorer" defaultValue="0" />
10-
<SettingChooserDevelopment label="Development Mode" selector="options" setter="setDevelopment" />
10+
<SettingChooserDevelopment label="Development Mode" selector="options" setter="setDevelopment" /> -->
1111
<b-button :style="{ marginTop: '1em' }" @click="refresh" type="is-danger is-light">Clear Cache & Reload</b-button>
1212
</div>
1313
</template>

dashboard/src/icons.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import {
44
// faPlay, faFolderOpen, faAddressBook,
55
// faCalendarCheck, faCogs, faEyeSlash,
66
// faExclamationCircle, faAngleDoubleLeft,
7-
// faAngleDoubleRight, faCaretDown,
7+
// faAngleDoubleRight,
88
// faCaretUp, faFile, faBook,
9-
// faCodeBranch, faSearch,
9+
// faCodeBranch,
1010
// faArrowUp, faTools, faCheck, faSeedling, faDatabase, faGem,
1111
// faInfoCircle, faExchangeAlt, faBug, faStop, faEllipsisV, faPercent,
1212
// faUsersCog, faCoins, faAngleLeft, faAngleRight,
@@ -18,7 +18,7 @@ import {
1818
faKey, faExternalLinkAlt, faUpload, faUsers,
1919
faQuestionCircle, faMinus,
2020
faChevronDown, faChevronUp,
21-
faHeart
21+
faHeart, faSearch, faCaretDown
2222
} from '@fortawesome/free-solid-svg-icons';
2323

2424
// throws error, idk why
@@ -48,7 +48,9 @@ library.add(
4848
faKey, faExternalLinkAlt, faUpload, faUsers,
4949
faQuestionCircle, faMinus,
5050
faChevronDown, faChevronUp,
51-
faTwitter, faTelegram, faLine, faHeart
51+
faTwitter, faTelegram,
52+
faLine, faHeart, faSearch,
53+
faCaretDown
5254
);
5355

5456
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';

dashboard/src/textile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Client, KeyInfo, ThreadID } from '@textile/hub'
1+
import { Client, KeyInfo } from '@textile/hub'
22

33
export async function client(): Promise<Client> {
44
return await Client.withKeyInfo(keyInfo)

dashboard/src/utils/account.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { KeyringAccount } from '@/types';
22
import keyring from '@polkadot/ui-keyring';
33
import { getAddress } from '@/extension'
4+
import { decodeAddress, encodeAddress, } from '@polkadot/util-crypto';
5+
import store from '@/store'
46

57
export const isAccountLocked = (account: KeyringAccount | string): boolean => {
68
const address = typeof account === 'string' ? account : account.address;
@@ -24,4 +26,18 @@ const passwordRequired = async (account: KeyringAccount | string) => {
2426
return isAccountLocked(address)
2527
}
2628

29+
const accountToAddress = (account: KeyringAccount | string) => typeof account === 'string' ? account : account.address;
30+
31+
export const toDefaultAddress = (account: KeyringAccount | string) => {
32+
const address = accountToAddress(account);
33+
if (/^5/.test(address)) {
34+
return address
35+
}
36+
37+
const ss58Format = store.getters.getChainProperties?.ss58Format
38+
39+
return encodeAddress(decodeAddress(address, ss58Format));
40+
41+
}
42+
2743
export default passwordRequired

dashboard/src/utils/transactionExecutor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { KeyringAccount } from '@/types';
33
import { SubmittableExtrinsic } from '@polkadot/api/types';
44
import { Callback } from '@polkadot/types/types';
55
import { getAddress } from '@/extension';
6+
import { toDefaultAddress } from '@/utils/account'
67

78
export type ExecResult = (() => void) | string
89

@@ -19,7 +20,7 @@ const exec = async (account: KeyringAccount | string, password: string | null, c
1920
try {
2021
const transfer = await callback(...params);
2122
const address = typeof account === 'string' ? account : account.address;
22-
const injector = await getAddress(address);
23+
const injector = await getAddress(toDefaultAddress(address));
2324
if (injector) {
2425
const h = await transfer.signAndSend(address, { signer: injector.signer }, statusCb);
2526
return h

0 commit comments

Comments
 (0)