Ir para o conteúdo principal

Blocking Mode

em Apps
Lista de autores
Publicado: 10 de mar. de 2022|Última atualização: 10 de mar. de 2022

Sometimes it's necessary to stop a user's interatction with an app whilst it is busy. This could be when your app is performing a time-intensive activity, e.g. like sending large payloads to an API. Stopping the user's interaction may help stop your app getting into an invalid state whilst "blocking" background processes operate.

Basic UsageCopy link to Basic Usage to clipboard

To use blocking mode from your app, call the setBlocking(true | false) from the app SDK client:

import { useInitialisedDeskproAppClient } from "@deskpro/app-sdk"; export const MyComponent = () => { useInitialisedDeskproAppClient((client) => { // Enable blocking mode client.setBlocking(true); // Disable blocking mode // client.setBlocking(false); }); // ... };
copy

Enabling blocking mode will render the following screen, blocking user interaction but maintaining the app's running state in the background.

image.png

ÚtilNão útil
próxima páginaOAuth Flows
página anteriorDeskpro UI

Por favor, faça login ou registre-se para enviar um comentário.