MOBILE-3153 usertours: Disable from config

main
Noel De Martin 2022-03-08 18:12:33 +01:00
parent bd37ed4345
commit 0a24df0f28
2 changed files with 7 additions and 0 deletions

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { CoreConstants } from '@/core/constants';
import { asyncInstance } from '@/core/utils/async-instance';
import { Injectable } from '@angular/core';
import { CoreDatabaseTable } from '@classes/database/database-table';
@ -60,6 +61,10 @@ export class CoreUserToursService {
* @returns Whether the User Tour is pending or not.
*/
async isPending(id: string): Promise<boolean> {
if (CoreConstants.CONFIG.disableUserTours || CoreConstants.CONFIG.disabledUserTours?.includes(id)) {
return false;
}
const isAcknowledged = await this.table.hasAnyByPrimaryKey({ id });
return !isAcknowledged;

View File

@ -34,6 +34,8 @@ export interface EnvironmentConfig {
languages: Record<string, string>;
databaseOptimizations?: Partial<CoreDatabaseConfiguration>;
databaseTableOptimizations?: Record<string, Partial<CoreDatabaseConfiguration>>;
disableUserTours?: boolean;
disabledUserTours?: string[];
wsservice: string;
demo_sites: Record<string, CoreSitesDemoSiteData>;
zoomlevels: Record<CoreZoomLevel, number>;