mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Merge pull request #1849 from hmhealey/plt1578
PLT-571 Restricted file uploads on iOS Chrome and the iOS app to work around iOS bugs
This commit is contained in:
@@ -74,6 +74,21 @@ export function isSafari() {
|
||||
return false;
|
||||
}
|
||||
|
||||
export function isIosChrome() {
|
||||
// https://developer.chrome.com/multidevice/user-agent
|
||||
return navigator.userAgent.indexOf('CriOS') !== -1;
|
||||
}
|
||||
|
||||
export function isMobileApp() {
|
||||
const userAgent = navigator.userAgent;
|
||||
|
||||
// the mobile app has different user agents for the native api calls and the shim, so handle them both
|
||||
const isApi = userAgent.indexOf('Mattermost') !== -1;
|
||||
const isShim = userAgent.indexOf('iPhone') !== -1 && userAgent.indexOf('Safari') === -1 && userAgent.indexOf('Chrome') === -1;
|
||||
|
||||
return isApi || isShim;
|
||||
}
|
||||
|
||||
export function isInRole(roles, inRole) {
|
||||
var parts = roles.split(' ');
|
||||
for (var i = 0; i < parts.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user