Skip to content

Commit

Permalink
web-fix: Add error for wc session expiration, closes #154
Browse files Browse the repository at this point in the history
Signed-off-by: Mikhail Petrov <[email protected]>
  • Loading branch information
mike-petrov committed Feb 6, 2024
1 parent 4433668 commit 9638115
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ const Profile = ({
scopes: 1, // WitnessScope.CalledByEntry
}];

if (wcSdk.session.expiry * 1000 < new Date().getTime()) {
onModal('failed', 'Session expired, re-login to continue');
}

const response = await wcSdk.testInvoke({ invocations, signers }).catch((error) => {
if (error.message) {
onModal('failed', error.message);
Expand All @@ -132,7 +136,6 @@ const Profile = ({
const onGetContainers = () => {
setIsLoadingContainers(true);
api('GET', `/containers?ownerId=${walletData.account}`).then((e) => {
onModal();
if (e.message) {
onPopup('failed', e.message);
} else {
Expand Down

0 comments on commit 9638115

Please sign in to comment.