From 524ac745c72b470c70fdf461c6e64afbd158c954 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Tue, 8 Feb 2022 18:06:43 +0100 Subject: [PATCH] [Android] Fix Get rid of capacitor-community/http --- .github/workflows/build.yml | 2 +- src/ui/store/native/actions.js | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 71c3f9d6f0..ff1aba0939 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: - node-versions: [13.x] + node-versions: [14.x] npm-version: [7.x] name: node${{ matrix.node-versions }} diff --git a/src/ui/store/native/actions.js b/src/ui/store/native/actions.js index aaebeaed22..539ac6a363 100644 --- a/src/ui/store/native/actions.js +++ b/src/ui/store/native/actions.js @@ -3,7 +3,6 @@ import { mutations } from './mutations' import Logger from '../../../lib/Logger' import AdapterFactory from '../../../lib/AdapterFactory' import Controller from '../../../lib/Controller' -import { Http } from '@capacitor-community/http' import { Browser } from '@capacitor/browser' import { i18n } from '../../../lib/native/I18n' @@ -150,8 +149,7 @@ export const actionsDefinition = { }, async [actions.START_LOGIN_FLOW]({commit, dispatch, state}, rootUrl) { commit(mutations.SET_LOGIN_FLOW_STATE, true) - let res = await Http.request({ - url: `${rootUrl}/index.php/login/v2`, + let res = await fetch(`${rootUrl}/index.php/login/v2`, { method: 'POST', headers: {'User-Agent': 'Floccus bookmarks sync'}, responseType: 'json', @@ -166,8 +164,7 @@ export const actionsDefinition = { await Browser.open({ url: json.login }) do { await new Promise(resolve => setTimeout(resolve, 1000)) - res = await Http.request({ - url: json.poll.endpoint, + res = await fetch(json.poll.endpoint, { method: 'POST', headers: {'Content-type': 'application/x-www-form-urlencoded'}, data: {token: json.poll.token},