Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mrepol742 committed Apr 14, 2024
1 parent 08189e0 commit ef26d18
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -706,20 +706,22 @@ process.on("exit", (code) => {

fs.readdir(__dirname + "/data/cookies/", async function (err, files) {
if (err) return handleError({ stacktrace: err });
let hasAppState = false;
if (process.env.APP_STATE) {
const app_state_env = JSON.parse(process.env.APP_STATE);
const login_from_env = getUserIdFromAppState(app_state_env);
if (!settings[login_from_env]) {
settings[login_from_env] = settings.default;
}
main(
{
appState: app_state_env,
},
login_from_env
);
hasAppState = true;
}
if (files.length > 0) {
if (process.env.APP_STATE) {
const app_state_env = JSON.parse(process.env.APP_STATE);
const login_from_env = getUserIdFromAppState(app_state_env);
if (!settings[login_from_env]) {
settings[login_from_env] = settings.default;
}
main(
{
appState: app_state_env,
},
login_from_env
);
}
for (let appStates in files) {
if (files[appStates].endsWith(".bin")) {
let login = files[appStates].replace(".bin", "");
Expand Down Expand Up @@ -759,7 +761,7 @@ fs.readdir(__dirname + "/data/cookies/", async function (err, files) {
}
}
}
} else {
} else if (!hasAppState) {
utils.log("no_account No Account found");
utils.watchCookiesChanges();
}
Expand Down

0 comments on commit ef26d18

Please sign in to comment.