Skip to content

Commit

Permalink
fix: rpc error
Browse files Browse the repository at this point in the history
  • Loading branch information
mosshqq committed Dec 30, 2024
1 parent f3085dc commit 6c0868b
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 27 deletions.
14 changes: 5 additions & 9 deletions packages/popup/src/hooks/useApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -697,16 +697,12 @@ export const usePreferences = (stop = false) => {
return {data, mutate}
}

export const useSidePanel = (stop = false) => {
const {data: enabled} = useRPC(
stop ? null : [WALLET_GET_SIDE_PANEL_ENABLED],
undefined,
{
refreshInterval: 0,
},
)
export const useSidePanel = () => {
const {data: enabled} = useRPC([WALLET_GET_SIDE_PANEL_ENABLED], undefined, {
refreshInterval: 0,
})
const {data: isSupported} = useRPC(
stop ? null : [WALLET_GET_SIDE_PANEL_SUPPORTED],
[WALLET_GET_SIDE_PANEL_SUPPORTED],
undefined,
{
refreshInterval: 0,
Expand Down
4 changes: 3 additions & 1 deletion packages/popup/src/pages/Home/components/Setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ function Setting({onClose, open, settingAnimate = true}) {
}
variant="text"
color="primary"
className="!bg-bg hover:!bg-primary-10 hover:text-primary group max-w-[8rem]"
className={`!bg-bg hover:!bg-primary-10 hover:text-primary group ${
isSidePanelSupported ? 'max-w-[8rem]' : ''
}`}
id="lockBtn"
onClick={onLock}
>
Expand Down
5 changes: 1 addition & 4 deletions packages/rpcs/wallet_getSidePanelEnabled/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import {optParam} from '@fluent-wallet/spec'
import {SIDE_PANEL_KEY} from '@fluent-wallet/consts'
import browser from 'webextension-polyfill'

export const NAME = 'wallet_getSidePanelEnabled'

const getSidePanel = () => browser.storage.local.get(SIDE_PANEL_KEY)

export const schemas = {
input: optParam,
}
export const schemas = {}

export const permissions = {
external: ['popup'],
Expand Down
1 change: 0 additions & 1 deletion packages/rpcs/wallet_getSidePanelEnabled/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"version": "0.0.1",
"dependencies": {
"@fluent-wallet/consts": "workspace:*",
"@fluent-wallet/spec": "workspace:*",
"webextension-polyfill": "0.8.0"
}
}
6 changes: 1 addition & 5 deletions packages/rpcs/wallet_getSidePanelSupported/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import {optParam} from '@fluent-wallet/spec'

export const NAME = 'wallet_getSidePanelSupported'

const isServiceWorker = () => {
Expand All @@ -10,9 +8,7 @@ const isServiceWorker = () => {
)
}

export const schemas = {
input: optParam,
}
export const schemas = {}

export const permissions = {
external: ['popup'],
Expand Down
5 changes: 1 addition & 4 deletions packages/rpcs/wallet_getSidePanelSupported/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,5 @@
"type": "module",
"main": "index.js",
"packageManager": "yarn@3.1.0",
"version": "0.0.1",
"dependencies": {
"@fluent-wallet/spec": "workspace:*"
}
"version": "0.0.1"
}
3 changes: 0 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5540,16 +5540,13 @@ __metadata:
resolution: "@fluent-wallet/wallet_get-side-panel-enabled@workspace:packages/rpcs/wallet_getSidePanelEnabled"
dependencies:
"@fluent-wallet/consts": "workspace:*"
"@fluent-wallet/spec": "workspace:*"
webextension-polyfill: "npm:0.8.0"
languageName: unknown
linkType: soft

"@fluent-wallet/wallet_get-side-panel-supported@workspace:*, @fluent-wallet/wallet_get-side-panel-supported@workspace:packages/rpcs/wallet_getSidePanelSupported":
version: 0.0.0-use.local
resolution: "@fluent-wallet/wallet_get-side-panel-supported@workspace:packages/rpcs/wallet_getSidePanelSupported"
dependencies:
"@fluent-wallet/spec": "workspace:*"
languageName: unknown
linkType: soft

Expand Down

0 comments on commit 6c0868b

Please sign in to comment.