mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-10 17:15:59 +00:00
Prettier 3
This commit is contained in:
@@ -45,8 +45,7 @@ router.post(
|
||||
where: { id: guild_id },
|
||||
select: ["owner_id"],
|
||||
});
|
||||
if (guild.owner_id !== req.user_id)
|
||||
throw new HTTPError("You are not the owner of this guild", 401);
|
||||
if (guild.owner_id !== req.user_id) throw new HTTPError("You are not the owner of this guild", 401);
|
||||
|
||||
await Promise.all([
|
||||
Guild.delete({ id: guild_id }), // this will also delete all guild related data
|
||||
|
||||
@@ -41,8 +41,7 @@ router.delete(
|
||||
});
|
||||
|
||||
// disable webauthn if there are no keys left
|
||||
if (keys === 0)
|
||||
await User.update({ id: req.user_id }, { webauthn_enabled: false });
|
||||
if (keys === 0) await User.update({ id: req.user_id }, { webauthn_enabled: false });
|
||||
|
||||
res.sendStatus(204);
|
||||
},
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
const alphabet =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+";
|
||||
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+";
|
||||
|
||||
// binary to string lookup table
|
||||
const b2s = alphabet.split("");
|
||||
|
||||
@@ -20,6 +20,5 @@ import { Connection } from "./Connection";
|
||||
import { RefreshableConnection } from "./RefreshableConnection";
|
||||
|
||||
export class ConnectionStore {
|
||||
public static connections: Map<string, Connection | RefreshableConnection> =
|
||||
new Map();
|
||||
public static connections: Map<string, Connection | RefreshableConnection> = new Map();
|
||||
}
|
||||
|
||||
@@ -108,8 +108,7 @@ export async function initDatabase(): Promise<DataSource> {
|
||||
if (!(await dbExists())) {
|
||||
console.log("[Database] This appears to be a fresh database. Running initial DDL.");
|
||||
const qr = dbConnection.createQueryRunner();
|
||||
if (fs.existsSync(path.join(__dirname, "..", "migration", DatabaseType, "initial0.js")))
|
||||
await new (require(`../migration/${DatabaseType}-initial`).initial0)().up(qr);
|
||||
if (fs.existsSync(path.join(__dirname, "..", "migration", DatabaseType, "initial0.js"))) await new (require(`../migration/${DatabaseType}-initial`).initial0)().up(qr);
|
||||
}
|
||||
|
||||
console.log("[Database] Applying missing migrations, if any.");
|
||||
|
||||
@@ -18,8 +18,7 @@ export function parseGifResult(result: TenorGif) {
|
||||
export function getGifApiKey() {
|
||||
const { enabled, provider, apiKey } = Config.get().gif;
|
||||
if (!enabled) throw new HTTPError(`Gifs are disabled`);
|
||||
if (provider !== "tenor" || !apiKey)
|
||||
throw new HTTPError(`${provider} gif provider not supported`);
|
||||
if (provider !== "tenor" || !apiKey) throw new HTTPError(`${provider} gif provider not supported`);
|
||||
|
||||
return apiKey;
|
||||
}
|
||||
|
||||
@@ -3,8 +3,7 @@ import { VoicePayload } from "./Constants";
|
||||
import { WebRtcWebSocket } from "./WebRtcWebSocket";
|
||||
|
||||
export function Send(socket: WebRtcWebSocket, data: VoicePayload) {
|
||||
if (process.env.WRTC_WS_VERBOSE)
|
||||
console.log(`[WebRTC] Outgoing message: ${JSON.stringify(data)}`);
|
||||
if (process.env.WRTC_WS_VERBOSE) console.log(`[WebRTC] Outgoing message: ${JSON.stringify(data)}`);
|
||||
|
||||
let buffer: Buffer | string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user