fix: cine dialogue appearance

This commit is contained in:
Alireza 2021-06-25 17:04:37 -04:00 committed by Erik Ziegler
parent 70e4c55920
commit c654d0f69e

View File

@ -56,7 +56,7 @@ export default class ToolBarService {
*/ */
recordInteraction(interaction) { recordInteraction(interaction) {
const commandsManager = this._commandsManager; const commandsManager = this._commandsManager;
const { groupId, itemId, interactionType } = interaction; const { groupId, itemId, interactionType, commandName, commandOptions } = interaction;
switch (interactionType) { switch (interactionType) {
case 'action': { case 'action': {
@ -66,7 +66,7 @@ export default class ToolBarService {
this.state.primaryToolId = itemId; this.state.primaryToolId = itemId;
// TODO: Force run this for all contexts? Even inactive? // TODO: Force run this for all contexts? Even inactive?
// or... They'll just detect primaryToolId when they spin up and apply... // or... They'll just detect primaryToolId when they spin up and apply...
commandsManager.runCommand('setToolActive', interaction.commandOptions); commandsManager.runCommand('setToolActive', commandOptions);
break; break;
} }
case 'toggle': { case 'toggle': {
@ -74,7 +74,9 @@ export default class ToolBarService {
this.state.toggles[itemId] === undefined this.state.toggles[itemId] === undefined
? true ? true
: !this.state.toggles[itemId]; : !this.state.toggles[itemId];
interaction.commandOptions.toggledState = this.state.toggles[itemId]; if (commandOptions) {
commandOptions.toggledState = this.state.toggles[itemId];
}
break; break;
} }
default: default:
@ -86,11 +88,8 @@ export default class ToolBarService {
// NOTE: Should probably just do this for tools as well? // NOTE: Should probably just do this for tools as well?
// But would be nice if we could enforce at least the command name? // But would be nice if we could enforce at least the command name?
let unsubscribe; let unsubscribe;
if (interaction.commandName) { if (commandName) {
unsubscribe = commandsManager.runCommand( unsubscribe = commandsManager.runCommand(commandName, commandOptions);
interaction.commandName,
interaction.commandOptions
);
} }
// Storing the unsubscribe for later reseting // Storing the unsubscribe for later reseting