forked from pkp/ui-library
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkp/pkp-lib#10969 Address breaking change in vue3, where inject in pi…
…nia stores does not provide current component provides
- Loading branch information
1 parent
8e3368a
commit f180108
Showing
6 changed files
with
56 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
import {inject, onUnmounted} from 'vue'; | ||
import {onUnmounted} from 'vue'; | ||
import {injectFromCurrentInstance} from '@/utils/defineComponentStore'; | ||
|
||
export function useDataChanged(callback) { | ||
if (callback) { | ||
const registerDataChangeCallback = inject('registerDataChangeCallback'); | ||
const registerDataChangeCallback = injectFromCurrentInstance( | ||
'registerDataChangeCallback', | ||
); | ||
registerDataChangeCallback(callback); | ||
|
||
const unRegisterDataChangeCallback = inject('unRegisterDataChangeCallback'); | ||
const unRegisterDataChangeCallback = injectFromCurrentInstance( | ||
'unRegisterDataChangeCallback', | ||
); | ||
|
||
onUnmounted(() => { | ||
unRegisterDataChangeCallback(callback); | ||
}); | ||
} | ||
|
||
const triggerDataChange = inject('triggerDataChange'); | ||
const triggerDataChange = injectFromCurrentInstance('triggerDataChange'); | ||
|
||
return {triggerDataChange}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
src/managers/ReviewerManager/modals/workflowLogResponseModalStore.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters