forked from Ivasoft/mattermost-mobile
* Add app review * Use overlay instead of modal * Add fixes for ios * i18n-extract * Add to milliseconds function * Address review feedback * Add try to queryGlobalValue * added app review illustration * add feedback illustration * Add animations and feedback bot message * Restrict reviews to build environment variable * Fix bug with "dont ask anymore" * Add check for only supported servers * Add missing change * Use for await Co-authored-by: Daniel Espino <danielespino@MacBook-Pro-de-Daniel.local> Co-authored-by: Matthew Birtch <mattbirtch@gmail.com>
31 lines
885 B
TypeScript
31 lines
885 B
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {General} from '@constants';
|
|
import NetworkManager from '@managers/network_manager';
|
|
|
|
export const isNPSEnabled = async (serverUrl: string) => {
|
|
try {
|
|
const client = NetworkManager.getClient(serverUrl);
|
|
const manifests = await client.getPluginsManifests();
|
|
for (const v of manifests) {
|
|
if (v.id === General.NPS_PLUGIN_ID) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
} catch (error) {
|
|
return false;
|
|
}
|
|
};
|
|
|
|
export const giveFeedbackAction = async (serverUrl: string) => {
|
|
try {
|
|
const client = NetworkManager.getClient(serverUrl);
|
|
const post = await client.npsGiveFeedbackAction();
|
|
return {post};
|
|
} catch (error) {
|
|
return {error};
|
|
}
|
|
};
|