Skip to content

Commit

Permalink
fix: forgot to add reading token in commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Feb 24, 2024
1 parent bbf84c9 commit cbe67d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions src/commands/plugin_commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export async function shareActiveFile(plugin: GithubPublisher, repo: Repository
const frontmatter = file ? plugin.app.metadataCache.getFileCache(file)?.frontmatter : null;
if (file && frontmatter && isShared(frontmatter, plugin.settings, file, repo)) {
await shareOneNote(
await plugin.reloadOctokit(),
await plugin.reloadOctokit(repo?.smartKey),
file,
repo,
);
Expand All @@ -80,7 +80,7 @@ export async function shareActiveFile(plugin: GithubPublisher, repo: Repository
*/
export async function deleteCommands(plugin : GithubPublisher, repo: Repository | null, branchName: string): Promise<void> {
const repoFrontmatter = getRepoFrontmatter(plugin.settings, repo);
const publisher = await plugin.reloadOctokit();
const publisher = await plugin.reloadOctokit(repo?.smartKey);
const mono: MonoRepoProperties = {
frontmatter: Array.isArray(repoFrontmatter) ? repoFrontmatter[0] : repoFrontmatter,
repo
Expand All @@ -103,7 +103,7 @@ export async function deleteCommands(plugin : GithubPublisher, repo: Repository

export async function uploadAllNotes(plugin: GithubPublisher, repo: Repository | null, branchName: string): Promise<void> {
const statusBarItems = plugin.addStatusBarItem();
const publisher = await plugin.reloadOctokit();
const publisher = await plugin.reloadOctokit(repo?.smartKey);
const sharedFiles = publisher.getSharedFiles(repo);
const repoFrontmatter = getRepoFrontmatter(plugin.settings, repo);
const mono: MonoRepoProperties = {
Expand All @@ -130,7 +130,7 @@ export async function uploadAllNotes(plugin: GithubPublisher, repo: Repository |
*/

export async function uploadNewNotes(plugin: GithubPublisher, branchName: string, repo: Repository|null): Promise<void> {
const publisher = await plugin.reloadOctokit();
const publisher = await plugin.reloadOctokit(repo?.smartKey);
const repoFrontmatter = getRepoFrontmatter(plugin.settings, repo);
await shareNewNote(
publisher,
Expand All @@ -150,11 +150,11 @@ export async function uploadNewNotes(plugin: GithubPublisher, branchName: string
* @param {Repository | null} repo - Other repo if the command is called from the suggest_other_repo_command.ts
* @return {Promise<void>}
*/
export async function repositoryValidityActiveFile(plugin:GithubPublisher, branchName: string, repo: Repository | null): Promise<void> {
export async function repositoryValidityActiveFile(plugin:GithubPublisher, repo: Repository | null): Promise<void> {
const file = plugin.app.workspace.getActiveFile();
if (file) {
await checkRepositoryValidity(
await plugin.reloadOctokit(),
await plugin.reloadOctokit(repo?.smartKey),
repo,
file,
);
Expand All @@ -171,7 +171,7 @@ export async function repositoryValidityActiveFile(plugin:GithubPublisher, branc
* @return {Promise<void>}
*/
export async function uploadAllEditedNotes(plugin: GithubPublisher ,branchName: string, repo: Repository|null=null): Promise<void> {
const publisher = await plugin.reloadOctokit();
const publisher = await plugin.reloadOctokit(repo?.smartKey);
const repoFrontmatter = getRepoFrontmatter(plugin.settings, repo);

await shareAllEditedNotes(
Expand All @@ -192,8 +192,8 @@ export async function uploadAllEditedNotes(plugin: GithubPublisher ,branchName:
* @param {GithubPublisher} plugin
* @return {Promise<void>}
*/
export async function shareEditedOnly(branchName: string, repo: Repository|null, plugin: GithubPublisher) {
const publisher = await plugin.reloadOctokit();
export async function shareEditedOnly(branchName: string, repo: Repository|null, plugin: GithubPublisher): Promise<void> {
const publisher = await plugin.reloadOctokit(repo?.smartKey);
const repoFrontmatter = getRepoFrontmatter(plugin.settings, repo);
await shareOnlyEdited(
publisher,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/status_bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class ShareStatusBar {
this.statusBarItem.addClass("sharing");
this.statusBarItem.removeClass("found-attachments");

if (!this.noticeMobile?.noticeEl.children[0].classList.contains("load")) {
if (!this.noticeMobile?.noticeEl?.children[0]?.classList?.contains("load")) {
setTimeout(() => {
this.noticeMobile?.hide();
}, 4000);
Expand Down

0 comments on commit cbe67d4

Please sign in to comment.