js: Replace ZulipDesktop useragent check for old desktop app.

Checking for window.bridge !== undefined is how the old desktop app
had always been tested for in the JS codebase.

Also, "Zulip Desktop" is how this should have been spelled in the first place.

Tweaked by tabbott to provide a proper commit message.

Fixes #6580.
This commit is contained in:
akashnimare 2017-09-20 17:44:37 +05:30 committed by Tim Abbott
parent 0c7dbd2e8a
commit ab11b7213b
1 changed files with 2 additions and 1 deletions

View File

@ -47,7 +47,8 @@ function update_message_in_all_views(message_id, callback) {
}
exports.show_error_for_unsupported_platform = function () {
if (/ZulipDesktop/.test(navigator.userAgent)) {
// Check if the user is using old desktop app
if (window.bridge !== undefined) {
// We don't internationalize this string because it is long,
// and few users will have both the old desktop app and an
// internationalized version of Zulip anyway.