#21451 Fix WebGL disabled error message (#10589)

* #21451 Fix WebGl disabled error message

* #21451 Fix WebGl disabled error message

Signed-off-by: Rashmit Pankhania <rashmitpankhania@gmail.com>
Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>

* Fix message

Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>

* Fix ordering of cases in LocationShareErrors.ts

Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>

* Fix linting LocationPicker.tsx

Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>

* Fix eslint

Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>

* Fix file encoding for i18n CI issue

Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>

* Fix ts strict CI issue

Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>

---------

Signed-off-by: Rashmit Pankhania <rashmitpankhania@gmail.com>
Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>
Co-authored-by: Rashmit Pankhania <raspankh@publicisgroupe.net>
Co-authored-by: Kerry <kerrya@element.io>
This commit is contained in:
Rashmit Pankhania 2023-04-17 09:55:04 +05:30 committed by GitHub
parent 41c0b0881a
commit 7751f9c622
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 4 deletions

View file

@ -119,10 +119,13 @@ class LocationPicker extends React.Component<ILocationPickerProps, IState> {
}
} catch (e) {
logger.error("Failed to render map", e);
const errorType =
(e as Error)?.message === LocationShareError.MapStyleUrlNotConfigured
? LocationShareError.MapStyleUrlNotConfigured
: LocationShareError.Default;
const errorMessage = (e as Error)?.message;
let errorType;
if (errorMessage === LocationShareError.MapStyleUrlNotConfigured)
errorType = LocationShareError.MapStyleUrlNotConfigured;
else if (errorMessage.includes("Failed to initialize WebGL"))
errorType = LocationShareError.WebGLNotEnabled;
else errorType = LocationShareError.Default;
this.setState({ error: errorType });
}
}