I have a gmail add-on with CardAction - Logout:
And if in stack navigation there are few cards and user make "Logout" - appears "Back Arrow":
This is my logoutAction, it works fine, but do you have any ideas how to disable this back-arrow?
function logoutAction(e) {
var service = getOAuthService();
service.reset();
return CardService.newAuthorizationException()
.setAuthorizationUrl(service.getAuthorizationUrl())
.setResourceDisplayName("MY_PROJECT")
.throwException();
}
This is my simple Card, where I use my logoutAction:
function afterImportScreenBuild() {
var action = CardService.newAction().setFunctionName('logoutAction');
var cardHeader = CardService.newCardHeader()
.setTitle("MY_HEADER");
var viewButton = CardService.newTextButton()
.setText("BTN")
.setOpenLink(CardService.newOpenLink()
.setUrl("https://test.com/"));
var card = CardService.newCardBuilder()
.setHeader(cardHeader);
var section = CardService.newCardSection();
var textKeyValue = CardService.newKeyValue()
.setContent("MY_TIMELINE")
.setButton(viewButton);
card.addCardAction(CardService.newCardAction().setText('Logout').setOnClickAction(action));
section.addWidget(textKeyValue);
card.addSection(section);
return card.build();
}
If my logoutAction
would return ActionResponseBuilder
I could use popToRoot()
:
CardService.newActionResponseBuilder().setNavigation(
CardService.newNavigation().popToRoot()
).build()
But in logoutAction
I need to return newAuthorizationException()
and I have no ideas how I can сlear my navigation stack.