Skip to content

Commit

Permalink
fix: near tip redirect (#1777)
Browse files Browse the repository at this point in the history
- remove keystore remove
  • Loading branch information
rubenkristian authored Mar 23, 2023
1 parent 9219ed4 commit 8941358
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/components/common/SendTipButton/SendTipButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import ShowIf from '../show-if.component';
import { useStyles } from './SendTipButton.style';

import { COOKIE_INSTANCE_URL } from 'components/SelectServer';
import * as nearAPI from 'near-api-js';
import { PromptComponent } from 'src/components/atoms/Prompt/prompt.component';
import { useUserHook } from 'src/hooks/use-user.hook';
import { Comment } from 'src/interfaces/comment';
Expand Down Expand Up @@ -236,19 +235,14 @@ export const SendTipButton: React.FC<SendTipButtonProps> = props => {
const near = await Near.connect(network);
const wallet = near.provider.wallet;

const keyStore =
new nearAPI.keyStores.BrowserLocalStorageKeyStore();
const signInOptions = {
contractId: publicRuntimeConfig.nearTippingContractId,
methodNames: ['claim_tip', 'batch_claim_tips'],
successUrl: publicRuntimeConfig.appAuthURL + router.asPath,
failureUrl: publicRuntimeConfig.appAuthURL + router.asPath,
};

await Promise.all([
keyStore.clear(),
wallet.requestSignIn(signInOptions),
]);
await wallet.requestSignIn(signInOptions);
}}>
{i18n.t('Tipping.Prompt_Near.Btn.Right')}
</Button>
Expand Down

0 comments on commit 8941358

Please sign in to comment.