From 5462af0dc786700a2a70e4ed199ca9905e0ad6ce Mon Sep 17 00:00:00 2001 From: PizZaKatZe Date: Tue, 13 Apr 2021 01:41:26 +0200 Subject: [PATCH 1/2] Fix first login with empty local storage During first login on a new domain the local storage is empty. This led to a TypeError and hence blank black screen. --- front/src/Connexion/LocalUser.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front/src/Connexion/LocalUser.ts b/front/src/Connexion/LocalUser.ts index b8e0a204..56483976 100644 --- a/front/src/Connexion/LocalUser.ts +++ b/front/src/Connexion/LocalUser.ts @@ -14,8 +14,8 @@ export function isUserNameValid(value: string): boolean { return regexp.test(value); } -export function areCharacterLayersValid(value: string[]): boolean { - if (!value.length) return false; +export function areCharacterLayersValid(value: string[] | null): boolean { + if (!value || !value.length) return false; for (let i = 0; i < value.length; i++) { if (/^\w+$/.exec(value[i]) === null) { return false; From f82551016a30e37402285b23087f20997454fda6 Mon Sep 17 00:00:00 2001 From: kharhamel Date: Tue, 13 Apr 2021 11:24:57 +0200 Subject: [PATCH 2/2] FIX: in vertical mode, the coWebSite now open from the top --- front/dist/resources/style/cowebsite.scss | 13 +++++++++---- front/src/WebRtc/CoWebsiteManager.ts | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/front/dist/resources/style/cowebsite.scss b/front/dist/resources/style/cowebsite.scss index 33a6b6bf..b752728d 100644 --- a/front/dist/resources/style/cowebsite.scss +++ b/front/dist/resources/style/cowebsite.scss @@ -88,21 +88,26 @@ } } @media (max-aspect-ratio: 1/1) { + + #main-container { + display: flex; + flex-direction: column-reverse; + } #cowebsite { left: 0; - bottom: 0; + top: 0; width: 100%; height: 50%; display: flex; - flex-direction: column; + flex-direction: column-reverse; &.loading { - transform: translateY(90%); + transform: translateY(-90%); } &.hidden { - transform: translateY(100%); + transform: translateY(-100%); } main { diff --git a/front/src/WebRtc/CoWebsiteManager.ts b/front/src/WebRtc/CoWebsiteManager.ts index e352d70c..95885a53 100644 --- a/front/src/WebRtc/CoWebsiteManager.ts +++ b/front/src/WebRtc/CoWebsiteManager.ts @@ -32,7 +32,7 @@ class CoWebsiteManager { private resizing: boolean = false; private cowebsiteMainDom: HTMLDivElement; private cowebsiteAsideDom: HTMLDivElement; - + get width(): number { return this.cowebsiteDiv.clientWidth; } @@ -74,7 +74,7 @@ class CoWebsiteManager { private initResizeListeners() { const movecallback = (event:MouseEvent) => { - this.verticalMode ? this.height -= event.movementY / this.getDevicePixelRatio() : this.width -= event.movementX / this.getDevicePixelRatio(); + this.verticalMode ? this.height += event.movementY / this.getDevicePixelRatio() : this.width -= event.movementX / this.getDevicePixelRatio(); this.fire(); }