Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose RTLTextPluginStatus #8864

Merged
merged 9 commits into from
Oct 15, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove pluginRequested
ryanhamley committed Oct 14, 2019
commit 300918531e4482a8b36b4b34aefaed93de1f33e6
5 changes: 1 addition & 4 deletions src/source/rtl_text_plugin.js
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ const status = {
error: 'error'
};
let pluginStatus = status.unavailable;
let pluginRequested = false;
let pluginURL = null;
let foregroundLoadComplete = false;

@@ -38,16 +37,14 @@ export const registerForPluginAvailability = function(

export const clearRTLTextPlugin = function() {
pluginStatus = status.unavailable;
pluginRequested = false;
pluginURL = null;
};

export const setRTLTextPlugin = function(url: string, callback: ErrorCallback) {
if (pluginRequested) {
if (pluginStatus === status.loading || pluginStatus === status.loaded) {
throw new Error('setRTLTextPlugin cannot be called multiple times.');
}
pluginStatus = status.loading;
pluginRequested = true;
pluginURL = browser.resolveURL(url);
_completionCallback = (error?: Error) => {
if (error) {