Cleanup of variable naming

This commit is contained in:
Keavon Chambers
2021-07-14 20:11:51 -07:00
parent 34f058147e
commit c76bb608d3
8 changed files with 75 additions and 58 deletions

View File

@@ -150,7 +150,7 @@ import Minimap from "../panels/Minimap.vue";
import IconButton from "../widgets/buttons/IconButton.vue";
import PopoverButton, { PopoverButtonIcon } from "../widgets/buttons/PopoverButton.vue";
import { MenuDirection } from "../widgets/floating-menus/FloatingMenu.vue";
import { ResponseType, registerResponseHandler, Response, PromptConfirmationToCloseDocument } from "../../utilities/response-handler";
import { ResponseType, registerResponseHandler, Response, DisplayConfirmationToCloseDocument } from "../../utilities/response-handler";
const wasm = import("../../../wasm/pkg");
@@ -187,13 +187,11 @@ export default defineComponent({
},
mounted() {
// TODO: Move these somewhere more appropriate to act upon all panels
registerResponseHandler(ResponseType.PromptConfirmationToCloseDocument, (responseData: Response) => {
const promptData = responseData as PromptConfirmationToCloseDocument;
this.closeDocumentWithConfirmation(promptData.document_index);
registerResponseHandler(ResponseType.DisplayConfirmationToCloseDocument, (responseData: Response) => {
const data = responseData as DisplayConfirmationToCloseDocument;
this.closeDocumentWithConfirmation(data.document_index);
});
registerResponseHandler(ResponseType.PromptConfirmationToCloseAllDocuments, (_responseData: Response) => {
registerResponseHandler(ResponseType.DisplayConfirmationToCloseAllDocuments, (_responseData: Response) => {
this.closeAllDocumentsWithConfirmation();
});
},

View File

@@ -65,7 +65,6 @@ export default defineComponent({
this.documents = documentListData.open_documents;
}
});
registerResponseHandler(ResponseType.SetActiveDocument, (responseData: Response) => {
const documentData = responseData as SetActiveDocument;
if (documentData) this.activeDocument = documentData.document_index;