()
| 240 | } |
| 241 | |
| 242 | async function uninstall() { |
| 243 | try { |
| 244 | const pluginDir = Url.join(PLUGIN_DIR, plugin.id); |
| 245 | const state = await InstallState.new(plugin.id); |
| 246 | await Promise.all([ |
| 247 | loadAd(this), |
| 248 | fsOperation(pluginDir).delete(), |
| 249 | state.delete(state.storeUrl), |
| 250 | ]); |
| 251 | acode.unmountPlugin(plugin.id); |
| 252 | if (onUninstall) onUninstall(plugin.id); |
| 253 | installed = false; |
| 254 | update = false; |
| 255 | if (!plugin.price) { |
| 256 | await helpers.showInterstitialIfReady(); |
| 257 | } |
| 258 | render(); |
| 259 | } catch (err) { |
| 260 | window.log("error", err); |
| 261 | helpers.error(err); |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | async function buy(e) { |
| 266 | const $button = e.target; |
no test coverage detected