File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,12 +17,12 @@ import './style.css';
1717
1818let gifProvider = new Klipy ( ) ;
1919
20- // Switch to GIPHY if the user has provided their own API key
21- getSetting ( 'giphyApiKey' ) . then ( ( key ) => {
20+ async function initProvider ( ) {
21+ const key = await getSetting ( 'giphyApiKey' ) ;
2222 if ( key ) {
2323 gifProvider = new Giphy ( key ) ;
2424 }
25- } ) ;
25+ }
2626
2727// Debug mode is controlled by the DEBUG environment variable
2828// Set with DEBUG=true npm run build
@@ -277,7 +277,8 @@ function addToolbarButton(toolbar) {
277277 * Initialize the extension by adding buttons to existing toolbars
278278 * and watching for new ones.
279279 */
280- function init ( ) {
280+ async function init ( ) {
281+ await initProvider ( ) ;
281282 debugLog ( 'Initializing GIFs for GitHub...' ) ;
282283
283284 // Add buttons to existing toolbars
You can’t perform that action at this time.
0 commit comments