Skip to content

Commit e55d021

Browse files
committed
add ci for PR checks
1 parent 6562521 commit e55d021

2 files changed

Lines changed: 34 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release Obsidian plugin
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
workflow_dispatch:
8+
9+
env:
10+
PLUGIN_NAME: obsidian-wordpress
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Use Node.js
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: "14.x"
22+
23+
- name: Build
24+
id: build
25+
run: |
26+
npm install
27+
npm run build
28+

src/wp-profile-modal.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import WordpressPlugin from './main';
33
import { WpProfile } from './wp-profile';
44
import { EventType, WP_OAUTH2_REDIRECT_URI } from './consts';
55
import { WordPressClientReturnCode } from './wp-client';
6-
import { generateCodeVerifier, OAuth2Client } from './oauth2-client';
6+
import { generateCodeVerifier, OAuth2Client, WordPressOAuth2Token } from './oauth2-client';
77
import { AppState } from './app-state';
88
import { isValidUrl, showError } from './utils';
99
import { ApiType } from './plugin-settings';
@@ -62,11 +62,13 @@ class WpProfileModal extends AbstractModal {
6262
super(plugin);
6363

6464
this.profileData = Object.assign({}, profile);
65-
this.tokenGotRef = AppState.events.on(EventType.OAUTH2_TOKEN_GOT, async token => {
66-
this.profileData.wpComOAuth2Token = token;
65+
this.tokenGotRef = AppState.events.on(EventType.OAUTH2_TOKEN_GOT, async token=> {
66+
const tokenData = token as WordPressOAuth2Token;
67+
console.log('WpProfileModal.onTokenGot', tokenData);
68+
this.profileData.wpComOAuth2Token = tokenData;
6769
if (atIndex >= 0) {
6870
// if token is undefined, just remove it
69-
this.plugin.settings.profiles[atIndex].wpComOAuth2Token = token;
71+
this.plugin.settings.profiles[atIndex].wpComOAuth2Token = tokenData;
7072
await this.plugin.saveSettings();
7173
}
7274
});

0 commit comments

Comments
 (0)