montana/Russian/Site/messenger/dist/1567.3a0cce44c483323bc793.js
2026-05-18 18:05:32 +03:00

2 lines
1.2 KiB
JavaScript

"use strict";(self.webpackChunkmontana_messenger=self.webpackChunkmontana_messenger||[]).push([[1567],{21567(e,n,s){s.d(n,{check:()=>o});var a=s(55962);class t extends a.Resource{constructor(e){super(e.rid),this.available=!0,this.currentVersion=e.currentVersion,this.version=e.version,this.date=e.date,this.body=e.body,this.rawJson=e.rawJson}async download(e,n){d(n);const s=new a.Channel;e&&(s.onmessage=e);const t=await(0,a.invoke)("plugin:updater|download",{onEvent:s,rid:this.rid,...n});this.downloadedBytes=new a.Resource(t)}async install(){if(!this.downloadedBytes)throw new Error("Update.install called before Update.download");await(0,a.invoke)("plugin:updater|install",{updateRid:this.rid,bytesRid:this.downloadedBytes.rid}),this.downloadedBytes=void 0}async downloadAndInstall(e,n){d(n);const s=new a.Channel;e&&(s.onmessage=e),await(0,a.invoke)("plugin:updater|download_and_install",{onEvent:s,rid:this.rid,...n})}async close(){await(this.downloadedBytes?.close()),await super.close()}}async function o(e){d(e);const n=await(0,a.invoke)("plugin:updater|check",{...e});return n?new t(n):null}function d(e){e?.headers&&(e.headers=Array.from(new Headers(e.headers).entries()))}}}]);
//# sourceMappingURL=1567.3a0cce44c483323bc793.js.map