This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Use notification v1 #60
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6d631fd
Change useNotification to work with v1 JS API as well as v2
ms14981 81f8017
Refactor window options so the v1/v2 specific code is in getNotificat…
ms14981 b215fe2
Made types stricter
ms14981 ac16ccf
Fix bug with useChildWindow where a re-launch of the child window cau…
ms14981 da69869
Fix bug where calling 'close' before a previous call was finished cau…
ms14981 37cea91
Change type of error object from any to Error
ms14981 26f560a
Refactor search for correct window
ms14981 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { _Window } from "openfin/_v2/api/window/window"; | ||
|
||
const getChildWindowsV1 = (): Promise<fin.OpenFinWindow[]> => | ||
new Promise((resolve, reject) => { | ||
const application = fin.desktop.Application.getCurrent(); | ||
application.getChildWindows(resolve, reject); | ||
}); | ||
|
||
const getChildWindowsV2 = (): Promise<_Window[]> => | ||
new Promise((resolve, reject) => { | ||
fin.Application.getCurrent().then(async (application) => { | ||
const childWindows = await application.getChildWindows(); | ||
resolve(childWindows); | ||
}).catch(reject); | ||
}); | ||
|
||
export default (version: OpenFinJavaScriptAPIVersion): Promise<fin.OpenFinWindow[] | _Window[]> => | ||
version === OpenFinJavaScriptAPIVersion.ONE ? | ||
getChildWindowsV1() : | ||
getChildWindowsV2(); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this name check?