Skip to content
This repository was archived by the owner on Sep 13, 2023. It is now read-only.

Commit 8bf62f8

Browse files
committed
fix-request-01
1 parent 3615236 commit 8bf62f8

File tree

2 files changed

+18
-21
lines changed

2 files changed

+18
-21
lines changed

src/renderer/components/modals/settings-modal/SettingsModal.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
</header>
66

77
<section class="modal-card-body">
8-
<b-field label="Github Enterprise Users Only">
9-
<b-input
10-
type="text"
11-
ref="githubEnterpriseUrl"
12-
v-model="newSettings.githubEnterpriseUrl"
13-
placeholder="https://github.host/api/v3">
14-
</b-input>
8+
<b-field label="Github Enterprise Users Only">
9+
<b-input
10+
type="text"
11+
ref="githubEnterpriseUrl"
12+
v-model="newSettings.githubEnterpriseUrl"
13+
placeholder="https://github.host/api/v3">
14+
</b-input>
1515
</b-field>
1616
<b-field label="Personal access token">
1717
<b-input

src/renderer/store/modules/Note.js

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
import db from '@/datastore-notes';
22
import converter from '@/converter';
33
import path from 'path';
4+
45
// eslint-disable-next-line import/no-extraneous-dependencies
56
import { remote } from 'electron';
7+
import packageJson from '../../../../package';
68

79
const Octokit = require('@octokit/rest');
8-
let octokit = Octokit();
10+
let octokit = new Octokit({
11+
userAgent: 'code-notes'.concat(packageJson.version),
12+
mediaType: {
13+
format: 'application/vnd.github.v3+json',
14+
},
15+
});
916

1017
const state = {
1118
notes: [],
@@ -52,21 +59,11 @@ const actions = {
5259
if (store.rootState.Settings.settings.githubEnterpriseUrl) {
5360
octokit = Octokit({
5461
baseUrl: store.rootState.Settings.settings.githubEnterpriseUrl,
55-
userAgent: 'code-notes v1.2.3',
56-
auth: store.rootState.Settings.settings.githubPersonalAccessToken,
57-
mediaType: {
58-
format: 'application/vnd.github.v3+json',
59-
},
60-
});
61-
} else {
62-
octokit = Octokit({
63-
userAgent: 'code-notes v1.2.3',
64-
auth: store.rootState.Settings.settings.githubPersonalAccessToken,
65-
mediaType: {
66-
format: 'application/vnd.github.v3+json',
67-
},
6862
});
6963
}
64+
octokit = Octokit({
65+
auth: store.rootState.Settings.settings.githubPersonalAccessToken,
66+
});
7067

7168
octokit.gists.list().then((res) => {
7269
const promises = [];

0 commit comments

Comments
 (0)