Skip to content

Commit

Permalink
[Android] Fix Get rid of capacitor-community/http
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelklehr committed Feb 8, 2022
1 parent 1512ba9 commit 524ac74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
node-versions: [13.x]
node-versions: [14.x]
npm-version: [7.x]

name: node${{ matrix.node-versions }}
Expand Down
7 changes: 2 additions & 5 deletions src/ui/store/native/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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',
Expand All @@ -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},
Expand Down

0 comments on commit 524ac74

Please sign in to comment.