Skip to content

Commit d7abbc7

Browse files
committed
refactor: remove redundant dismissed tracking
1 parent fbccb81 commit d7abbc7

File tree

1 file changed

+5
-30
lines changed

1 file changed

+5
-30
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3998,41 +3998,32 @@ function RemoteFunctions(config = {}) {
39983998

39993999
/**
40004000
* Helper function to dismiss NodeMoreOptionsBox if it exists
4001-
* @return {boolean} true if box was dismissed, false if it didn't exist
40024001
*/
40034002
function dismissNodeMoreOptionsBox() {
40044003
if (_nodeMoreOptionsBox) {
40054004
_nodeMoreOptionsBox.remove();
40064005
_nodeMoreOptionsBox = null;
4007-
return true;
40084006
}
4009-
return false;
40104007
}
40114008

40124009
/**
40134010
* Helper function to dismiss NodeInfoBox if it exists
4014-
* @return {boolean} true if box was dismissed, false if it didn't exist
40154011
*/
40164012
function dismissNodeInfoBox() {
40174013
if (_nodeInfoBox) {
40184014
_nodeInfoBox.remove();
40194015
_nodeInfoBox = null;
4020-
return true;
40214016
}
4022-
return false;
40234017
}
40244018

40254019
/**
40264020
* Helper function to dismiss AIPromptBox if it exists
4027-
* @return {boolean} true if box was dismissed, false if it didn't exist
40284021
*/
40294022
function dismissAIPromptBox() {
40304023
if (_aiPromptBox) {
40314024
_aiPromptBox.remove();
40324025
_aiPromptBox = null;
4033-
return true;
40344026
}
4035-
return false;
40364027
}
40374028

40384029
/**
@@ -4042,26 +4033,20 @@ function RemoteFunctions(config = {}) {
40424033
if (_imageRibbonGallery) {
40434034
_imageRibbonGallery.remove();
40444035
_imageRibbonGallery = null;
4045-
return true;
40464036
}
4047-
return false;
40484037
}
40494038

40504039
/**
40514040
* Helper function to dismiss all UI boxes at once
4052-
* @return {boolean} true if any boxes were dismissed, false otherwise
40534041
*/
40544042
function dismissAllUIBoxes() {
4055-
let dismissed = false;
4056-
dismissed = dismissNodeMoreOptionsBox() || dismissed;
4057-
dismissed = dismissAIPromptBox() || dismissed;
4058-
dismissed = dismissNodeInfoBox() || dismissed;
4059-
return dismissed;
4043+
dismissNodeMoreOptionsBox();
4044+
dismissAIPromptBox();
4045+
dismissNodeInfoBox();
40604046
}
40614047

40624048
/**
40634049
* Helper function to cleanup previously clicked element highlighting and state
4064-
* @return {boolean} true if cleanup was performed, false if no element to cleanup
40654050
*/
40664051
function cleanupPreviousElementState() {
40674052
if (previouslyClickedElement) {
@@ -4078,26 +4063,16 @@ function RemoteFunctions(config = {}) {
40784063
}
40794064

40804065
previouslyClickedElement = null;
4081-
return true;
40824066
}
4083-
return false;
40844067
}
40854068

40864069
/**
40874070
* This function dismisses all UI elements and cleans up application state
40884071
* Called when user presses Esc key, clicks on HTML/Body tags, or other dismissal events
4089-
* @return {boolean} true if any cleanup was performed, false otherwise
40904072
*/
40914073
function dismissUIAndCleanupState() {
4092-
let dismissed = false;
4093-
4094-
// Dismiss all UI boxes
4095-
dismissed = dismissAllUIBoxes() || dismissed;
4096-
4097-
// Cleanup previously clicked element state and highlighting
4098-
dismissed = cleanupPreviousElementState() || dismissed;
4099-
4100-
return dismissed;
4074+
dismissAllUIBoxes();
4075+
cleanupPreviousElementState();
41014076
}
41024077

41034078

0 commit comments

Comments
 (0)