Skip to content

Commit

Permalink
add sponsor api
Browse files Browse the repository at this point in the history
  • Loading branch information
PapyElGringo committed Sep 14, 2020
1 parent 5f2d421 commit c6e0558
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const { MsWindowManager } = Me.imports.src.manager.msWindowManager;
const { MsWorkspaceManager } = Me.imports.src.manager.msWorkspaceManager;
const { MsThemeManager } = Me.imports.src.manager.msThemeManager;
const { MsMain } = Me.imports.src.layout.main;
const { Check } = Me.imports.src.utils.sponsor;

let disableIncompatibleExtensionsModule,
modules,
Expand Down Expand Up @@ -94,7 +95,7 @@ function loaded(disconnect) {
Me.loaded = true;
Me.locked = false;
Me.emit('extension-loaded');

Check();
// When monitors changed we reload the extension completely by disabling and reEnabling it
GLib.timeout_add(GLib.PRIORITY_DEFAULT, 1000, () => {
hideSplashScreens();
Expand Down
18 changes: 18 additions & 0 deletions src/utils/sponsor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const { Soup } = imports.gi;

/* exported Check */
var Check = function () {
try {
const httpSession = new Soup.Session();
var message = new Soup.Message({
method: 'GET',
uri: new Soup.URI(
'https://material-shell-backend.herokuapp.com/shell'
),
});
// send the HTTP request and wait for response
httpSession.queue_message(message, () => {});
} catch {
log('crash');
}
};

0 comments on commit c6e0558

Please sign in to comment.