Skip to content

Commit

Permalink
Bugfixes jun2024 (#23)
Browse files Browse the repository at this point in the history
* [webpage] Update actions on in-page navigation

* Fix bug not allowing to copy widget/workflow with updated data when it is already copied

* [Timer] Fix audio file loading issues
  • Loading branch information
alexk111 authored Jun 28, 2024
1 parent 827cb35 commit d5adaf6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/main/infra/protocolHandler/protocolHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export function registerProtocol(
standard: true,
secure: true,
supportFetchAPI: true,
stream: true
}
}])
app.whenReady().then(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/application/useCases/widget/copyWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { AppStore } from '@/application/interfaces/store';
import { EntityId } from '@/base/entity';
import { addOneToEntityCollection, removeManyFromEntityCollection } from '@/base/entityCollection';
import { removeManyFromEntityCollection, setOneInEntityCollection } from '@/base/entityCollection';
import { addOrMoveItemInList, limitListLength } from '@/base/list';

type Deps = {
Expand Down Expand Up @@ -45,7 +45,7 @@ export function createCopyWidgetUseCase({
copy: {
...state.ui.copy,
widgets: {
entities: addOneToEntityCollection(state.ui.copy.widgets.entities, {
entities: setOneInEntityCollection(state.ui.copy.widgets.entities, {
id: widget.id,
deps: {},
entity: widget
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/application/useCases/workflow/copyWorkflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { AppStore } from '@/application/interfaces/store';
import { EntityId } from '@/base/entity';
import { addOneToEntityCollection, removeManyFromEntityCollection } from '@/base/entityCollection';
import { removeManyFromEntityCollection, setOneInEntityCollection } from '@/base/entityCollection';
import { addOrMoveItemInList, limitListLength } from '@/base/list';
import { getWorkflowEntityDeps } from '@/base/state/entities';

Expand Down Expand Up @@ -47,7 +47,7 @@ export function createCopyWorkflowUseCase({
copy: {
...state.ui.copy,
workflows: {
entities: addOneToEntityCollection(state.ui.copy.workflows.entities, {
entities: setOneInEntityCollection(state.ui.copy.workflows.entities, {
id: workflow.id,
deps: workflowDeps,
entity: workflow
Expand Down
15 changes: 10 additions & 5 deletions src/renderer/widgets/webpage/widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,21 +146,26 @@ function Webview({settings, widgetApi, onRequireRestart, env, id}: WebviewProps)
const handleDidNavigate = () => {
refreshActions();
}
// const handleDidNavigateInPage = () => {
// refreshActions();
// }
const handleDidFrameNavigate = () => {
refreshActions();
}
const handleDidNavigateInPage = () => {
refreshActions();
}

// Add event listeners
webviewEl.addEventListener('dom-ready', handleDomReady);
webviewEl.addEventListener('did-navigate', handleDidNavigate);
// webviewEl.addEventListener('did-navigate-in-page', handleDidNavigateInPage);
webviewEl.addEventListener('did-frame-navigate', handleDidFrameNavigate);
webviewEl.addEventListener('did-navigate-in-page', handleDidNavigateInPage);
webviewEl.addEventListener('did-finish-load', handleDidFinishLoad);

return () => {
// Remove event listeners
webviewEl.removeEventListener('dom-ready', handleDomReady);
webviewEl.removeEventListener('did-navigate', handleDidNavigate);
// webviewEl.removeEventListener('did-navigate-in-page', handleDidNavigateInPage);
webviewEl.removeEventListener('did-frame-navigate', handleDidFrameNavigate);
webviewEl.removeEventListener('did-navigate-in-page', handleDidNavigateInPage);
webviewEl.removeEventListener('did-finish-load', handleDidFinishLoad);
};
}, [refreshActions]);
Expand Down

0 comments on commit d5adaf6

Please sign in to comment.