@deathnaitsa/wa-api 1.0.34 → 1.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Socket/index.js +6 -6
- package/package.json +1 -1
package/dist/Socket/index.js
CHANGED
|
@@ -292,22 +292,22 @@ const getAllSessionData = () => {
|
|
|
292
292
|
exports.getAllSessionData = getAllSessionData;
|
|
293
293
|
|
|
294
294
|
async function loadSessionsFromStorage() {
|
|
295
|
-
const dirPath = path_1.
|
|
295
|
+
const dirPath = path_1.default.resolveresolve(Defaults_1.CREDENTIALS.DIR_NAME);
|
|
296
296
|
const loadedSessions = [];
|
|
297
297
|
|
|
298
298
|
// Ordner anlegen, falls nicht existiert
|
|
299
|
-
if (!
|
|
300
|
-
|
|
299
|
+
if (!fs_1.default.existsSync(dirPath)) {
|
|
300
|
+
fs_1.default.mkdirSync(dirPath, { recursive: true });
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
try {
|
|
304
|
-
const entries = await
|
|
304
|
+
const entries = await fs_1.default.promises.readdir(dirPath);
|
|
305
305
|
|
|
306
306
|
for (const entry of entries) {
|
|
307
|
-
const fullPath = path_1.join(dirPath, entry);
|
|
307
|
+
const fullPath = path_1.default.resolve.join(dirPath, entry);
|
|
308
308
|
let stat;
|
|
309
309
|
try {
|
|
310
|
-
stat = await
|
|
310
|
+
stat = await fs_1.default.promises.stat(fullPath);
|
|
311
311
|
} catch {
|
|
312
312
|
// Wenn sich die Datei zwischenzeitlich entfernt hat o.Ä., überspringen
|
|
313
313
|
continue;
|