[MM-60284] Desktop app doesnt stop the initial loading indicator (#28056)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d5e7a6cf1f
Коммит
c2df4e413e
@@ -26,10 +26,25 @@ export class InitialLoadingScreenClass {
|
|||||||
constructor() {
|
constructor() {
|
||||||
this.loadingScreenElement = document.getElementById('initialPageLoadingScreen');
|
this.loadingScreenElement = document.getElementById('initialPageLoadingScreen');
|
||||||
this.loadingAnimationElement = document.getElementById('initialPageLoadingAnimation');
|
this.loadingAnimationElement = document.getElementById('initialPageLoadingAnimation');
|
||||||
|
|
||||||
this.initialLoadingScreenCSS = document.getElementById('initialLoadingScreenCSS') as HTMLLinkElement | null;
|
this.initialLoadingScreenCSS = document.getElementById('initialLoadingScreenCSS') as HTMLLinkElement | null;
|
||||||
|
|
||||||
this.handleAnimationEndEvent = this.handleAnimationEndEvent.bind(this);
|
this.handleAnimationEndEvent = this.handleAnimationEndEvent.bind(this);
|
||||||
|
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
private init() {
|
||||||
|
if (isDesktopApp()) {
|
||||||
|
// Let Mattermost desktop handle the loading screen
|
||||||
|
this.destroy();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.addAnimationEndListener();
|
||||||
|
|
||||||
|
// Starting automatically in the constructor instead of waiting for call from the code base
|
||||||
|
// as per the latest UX recommendation
|
||||||
|
this.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleAnimationEndEvent(event: AnimationEvent) {
|
private handleAnimationEndEvent(event: AnimationEvent) {
|
||||||
@@ -88,14 +103,6 @@ export class InitialLoadingScreenClass {
|
|||||||
* If we do want to do that then we should remove the set timeout destroy call doing above.
|
* If we do want to do that then we should remove the set timeout destroy call doing above.
|
||||||
*/
|
*/
|
||||||
public start() {
|
public start() {
|
||||||
if (isDesktopApp()) {
|
|
||||||
// Let Mattermost desktop handle the loading screen
|
|
||||||
this.destroy();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.addAnimationEndListener();
|
|
||||||
|
|
||||||
if (!this.loadingScreenElement || !this.loadingAnimationElement) {
|
if (!this.loadingScreenElement || !this.loadingAnimationElement) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.error('InitialLoadingScreen: No loading screen or animation element found');
|
console.error('InitialLoadingScreen: No loading screen or animation element found');
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user