Skip to content

Commit

Permalink
fix(startup): add additional condition when switching account type
Browse files Browse the repository at this point in the history
  • Loading branch information
rhahao committed Feb 26, 2023
1 parent effc19e commit 9e4a261
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/features/startup/vip/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const VipStartup = () => {
const runNotAuthenticatedStep = async () => {
const settings = await dbGetAppSettings();
const cong_name = settings.cong_name;
const cong_role = settings.cong_role || [];

if (isOfflineOverride) {
showSignup();
Expand All @@ -81,6 +82,14 @@ const VipStartup = () => {
return;
}

let approvedRole = cong_role.includes('lmmo');
if (!approvedRole) cong_role.includes('lmmo-backup');

if (!approvedRole) {
showSignup();
return;
}

if (cong_name.length > 0) {
setIsSetup(false);
await loadApp();
Expand Down Expand Up @@ -116,8 +125,12 @@ const VipStartup = () => {

const settings = await dbGetAppSettings();
const cong_name = settings.cong_name;
const cong_role = settings.cong_role;

let approvedRole = cong_role.includes('lmmo');
if (!approvedRole) cong_role.includes('lmmo-backup');

if (!isOfflineOverride && cong_name.length > 0) {
if (!isOfflineOverride && cong_name.length > 0 && approvedRole) {
setIsSetup(false);
await loadApp();
await runUpdater();
Expand Down Expand Up @@ -157,6 +170,7 @@ const VipStartup = () => {
setIsUserSignUp,
setUserMfaSetup,
setUserMfaVerify,
setIsCongAccountCreate,
showTermsUse,
visitorID,
]);
Expand Down

0 comments on commit 9e4a261

Please sign in to comment.