-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Related: * `TODO:2023-05-12-14-40-46` - Refactor: Update `RNIModalViewModule` functions to use promises.
- Loading branch information
1 parent
ab15df5
commit 5282bfb
Showing
4 changed files
with
29 additions
and
27 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
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 |
---|---|---|
@@ -1,26 +1,11 @@ | ||
import { RNIModalViewModule } from '../native_modules/RNIModalViewModule'; | ||
import * as Helpers from '../functions/helpers'; | ||
|
||
export class ModalViewModule { | ||
static async setModalVisibilityByID(modalID: string) { | ||
await RNIModalViewModule.setModalVisibilityByID(modalID); | ||
} | ||
|
||
static dismissAllModals(animated = true) { | ||
const promise = new Promise((resolve, reject) => { | ||
try { | ||
RNIModalViewModule.dismissAllModals(animated, (success) => { | ||
(success ? resolve : reject)(); | ||
}); | ||
|
||
// prettier-ignore | ||
} catch (error) { | ||
console.log('RNIModalViewModule, dismissAllModals error:'); | ||
console.log(error); | ||
reject(); | ||
} | ||
}); | ||
|
||
return Helpers.promiseWithTimeout(1000, promise); | ||
static async dismissAllModals(animated = true) { | ||
await RNIModalViewModule.dismissAllModals(animated); | ||
} | ||
} |
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