mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-24 06:07:45 -06:00
Merge branch 'develop' into main
This commit is contained in:
@@ -3,6 +3,8 @@ import fs from 'fs';
|
||||
import i18next from 'i18next';
|
||||
import path from 'path';
|
||||
|
||||
const __dirname = path.resolve(process.cwd(), 'src', 'utils');
|
||||
|
||||
const languages = ['en', 'pt-BR', 'es'];
|
||||
const translationsPath = path.join(__dirname, 'translations');
|
||||
const configService: ConfigService = new ConfigService();
|
||||
@@ -12,8 +14,9 @@ const resources: any = {};
|
||||
languages.forEach((language) => {
|
||||
const languagePath = path.join(translationsPath, `${language}.json`);
|
||||
if (fs.existsSync(languagePath)) {
|
||||
const translationContent = fs.readFileSync(languagePath, 'utf8');
|
||||
resources[language] = {
|
||||
translation: require(languagePath),
|
||||
translation: JSON.parse(translationContent),
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
@@ -153,7 +153,7 @@ export default async function useMultiFileAuthStatePrisma(
|
||||
ids.map(async (id) => {
|
||||
let value = await readData(`${type}-${id}`);
|
||||
if (type === 'app-state-sync-key' && value) {
|
||||
value = proto.Message.AppStateSyncKeyData.fromObject(value);
|
||||
value = proto.Message.AppStateSyncKeyData.create(value);
|
||||
}
|
||||
|
||||
data[id] = value;
|
||||
|
||||
@@ -100,7 +100,7 @@ export class AuthStateProvider {
|
||||
ids.map(async (id) => {
|
||||
let value = await readData(`${type}-${id}`);
|
||||
if (type === 'app-state-sync-key' && value) {
|
||||
value = proto.Message.AppStateSyncKeyData.fromObject(value);
|
||||
value = proto.Message.AppStateSyncKeyData.create(value);
|
||||
}
|
||||
|
||||
data[id] = value;
|
||||
|
||||
@@ -50,7 +50,7 @@ export async function useMultiFileAuthStateRedisDb(
|
||||
ids.map(async (id) => {
|
||||
let value = await readData(`${type}-${id}`);
|
||||
if (type === 'app-state-sync-key' && value) {
|
||||
value = proto.Message.AppStateSyncKeyData.fromObject(value);
|
||||
value = proto.Message.AppStateSyncKeyData.create(value);
|
||||
}
|
||||
|
||||
data[id] = value;
|
||||
|
||||
Reference in New Issue
Block a user