Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ormiz committed Feb 4, 2024
1 parent 4178882 commit c5ecd2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
14 changes: 2 additions & 12 deletions examples/client/Locomotion/src/context/user/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,33 +182,23 @@ const UserContextProvider = ({ children }: { children: any }) => {
demandSourceId,
switchDemandSource

Check failure on line 183 in examples/client/Locomotion/src/context/user/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Missing trailing comma
});
console.log('onLogin', response, switchDemandSource);
if (switchDemandSource && response.demandSourceId &&

Check failure on line 185 in examples/client/Locomotion/src/context/user/index.tsx

View workflow job for this annotation

GitHub Actions / lint

'&&' should be placed at the beginning of the line
response.demandSourceId !== demandSourceId) {
await AppSettings.setSettings({
OPERATION_ID: response.demandSourceId
});
await AppSettings.setOperationId(response.demandSourceId);
}
// successful login - delete captcha token
await StorageService.delete('captchaToken');
};

const onVert = async (code: string) => {
const demandSourceId = await AppSettings.getOperationId();
const switchDemandSource = Config.SWITCH_DEMAND_SOURCE === 'true';
try {
const vertResponse = await loginVert({
phoneNumber: user?.phoneNumber,
code,
demandSourceId,
switchDemandSource
});
console.log('onVert', vertResponse, switchDemandSource);
if (switchDemandSource && vertResponse.demandSourceId !== demandSourceId) {
await AppSettings.setSettings({
OPERATION_ID: vertResponse.demandSourceId
});
}

if (vertResponse.status !== 'OK' || !vertResponse.refreshToken || !vertResponse.accessToken) {
console.log('Bad vert with response', vertResponse);
return false;
Expand Down
1 change: 1 addition & 0 deletions examples/client/Locomotion/src/services/app-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const AppSettings = {
},
});
},
setOperationId: async (newOperationId) => AppSettings.setSettings({ operationId: newOperationId }),

Check failure on line 34 in examples/client/Locomotion/src/services/app-settings.js

View workflow job for this annotation

GitHub Actions / lint

Unexpected parentheses around single function argument having a body with no curly braces
destroy: async () => Storage.clear(),
};

Expand Down

0 comments on commit c5ecd2a

Please sign in to comment.