fix: update Jitsi configuration handling for default values
- Refactored the Jitsi configuration logic to use nullish coalescing for default values in the frontend. - Added a condition to reset configuration values to defaults when no configuration is available. - Adjusted backend mutation to ensure consistent handling of the acceptSelfSignedCert parameter.
This commit is contained in:
@@ -29,8 +29,15 @@
|
||||
domain = configAtual.data.domain || "";
|
||||
appId = configAtual.data.appId || "sgse-app";
|
||||
roomPrefix = configAtual.data.roomPrefix || "sgse";
|
||||
useHttps = configAtual.data.useHttps || false;
|
||||
acceptSelfSignedCert = configAtual.data.acceptSelfSignedCert || false;
|
||||
useHttps = configAtual.data.useHttps ?? false;
|
||||
acceptSelfSignedCert = configAtual.data.acceptSelfSignedCert ?? false;
|
||||
} else if (configAtual === null) {
|
||||
// Se não há configuração, resetar para valores padrão
|
||||
domain = "";
|
||||
appId = "sgse-app";
|
||||
roomPrefix = "sgse";
|
||||
useHttps = false;
|
||||
acceptSelfSignedCert = false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ export const salvarConfigJitsi = mutation({
|
||||
appId: args.appId.trim(),
|
||||
roomPrefix: args.roomPrefix.trim(),
|
||||
useHttps: args.useHttps,
|
||||
acceptSelfSignedCert: args.acceptSelfSignedCert ?? false, // Default para false se não fornecido
|
||||
acceptSelfSignedCert: args.acceptSelfSignedCert,
|
||||
ativo: true,
|
||||
configuradoPor: args.configuradoPorId,
|
||||
atualizadoEm: Date.now(),
|
||||
|
||||
Reference in New Issue
Block a user