Skip to content

Commit

Permalink
Update Code Style
Browse files Browse the repository at this point in the history
  • Loading branch information
otaviocc committed Jan 1, 2024
1 parent b675249 commit ed083be
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/MicroPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ export default class MicroPlugin extends Plugin {
})

this.addRibbonIcon(
"message-circle",
"Compose Micropost",
'message-circle',
'Compose Micropost',
() => {
this.openMicropostView()
}
Expand Down
2 changes: 1 addition & 1 deletion src/networking/NetworkClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class NetworkClient implements NetworkClientInterface {
// Public

public async run<T>(request: NetworkRequest): Promise<T> {
const url = 'https://micro.blog' + request.path + (request.parameters ? '?' + request.parameters : "")
const url = 'https://micro.blog' + request.path + (request.parameters ? '?' + request.parameters : '')

const response = await fetch(url, {
method: request.method,
Expand Down
2 changes: 1 addition & 1 deletion src/networking/NetworkRequestFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface NetworkRequestFactoryInterface {
navigation: boolean
): NetworkRequest

// Builds the configuration request, `NetworkRequest` used to "log in"
// Builds the configuration request, `NetworkRequest` used to log in
// the user. The config network request returns the list of blogs the
// user can post to.
makeConfigRequest(): NetworkRequest
Expand Down
4 changes: 2 additions & 2 deletions src/networking/NewPostRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export type NewPostRequest = {
'type': string[]
'mp-destination'?: string
'properties': {
"name"?: string[]
'name'?: string[]
'content': string[],
'category': string[],
'published'?: string[],
Expand All @@ -26,7 +26,7 @@ export function makeNewPostRequest(
'type': ["h-entry"],
...blogID.length > 0 && blogID !== 'default' && { 'mp-destination': blogID },
'properties': {
...title.length > 0 && { "name": [title] },
...title.length > 0 && { 'name': [title] },
'content': [content],
'category': categories,
...published.length > 0 && { 'published': [published] },
Expand Down
4 changes: 2 additions & 2 deletions src/networking/UpdatePostRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type UpdatePostRequest = {
'mp-destination': string
'replace': {
'content': string[],
"name": string[]
'name': string[]
}
}

Expand All @@ -24,7 +24,7 @@ export function makeUpdatePostRequest(
'mp-destination': blogID,
'replace': {
'content': [content],
"name": [title]
'name': [title]
}
}
}
2 changes: 1 addition & 1 deletion src/views/MicropostView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class MicropostView extends Modal implements MicropostViewModelDelegate {
this.viewModel.content = value
})
.then(textArea => {
textArea.inputEl.style.width = "100%";
textArea.inputEl.style.width = '100%'
textArea.inputEl.rows = 10;
})

Expand Down
14 changes: 7 additions & 7 deletions src/views/MicropostViewModel.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NetworkClientInterface } from "@networking/NetworkClient";
import { NetworkRequestFactoryInterface } from "@networking/NetworkRequestFactory";
import { PublishResponse } from "@networking/PublishResponse";
import { NetworkClientInterface } from '@networking/NetworkClient'
import { NetworkRequestFactoryInterface } from '@networking/NetworkRequestFactory'
import { PublishResponse } from '@networking/PublishResponse'

export enum SubmitButtonStyle {
Disabled,
Expand Down Expand Up @@ -61,8 +61,8 @@ export class MicropostViewModel {
networkRequestFactory: NetworkRequestFactoryInterface
) {
this.visibilityWrappedValue = visibility
this.contentWrappedValue = ""
this.plainTextContent = ""
this.contentWrappedValue = ''
this.plainTextContent = ''
this.blogs = blogs
this.selectedBlogIDWrappedValue = selectedBlogID
this.networkClient = networkClient
Expand Down Expand Up @@ -114,12 +114,12 @@ export class MicropostViewModel {

try {
const request = this.networkRequestFactory.makePublishPostRequest(
"",
'',
this.content,
[],
this.visibility,
this.selectedBlogID,
""
''
)

const result = await this.networkClient.run<PublishResponse>(
Expand Down
6 changes: 3 additions & 3 deletions src/views/PublishPageView.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PublishResponse } from "@networking/PublishResponse"
import { PublishPageViewModel, PublishPageViewModelDelegate } from "@views/PublishPageViewModel"
import { App, Modal, Setting } from "obsidian"
import { PublishResponse } from '@networking/PublishResponse'
import { PublishPageViewModel, PublishPageViewModelDelegate } from '@views/PublishPageViewModel'
import { App, Modal, Setting } from 'obsidian'

/*
* `PublishPageView` subclasses `Modal` and is presented via Obsidian's
Expand Down
4 changes: 2 additions & 2 deletions src/views/PublishPageViewModel.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NetworkClientInterface } from '@networking/NetworkClient'
import { NetworkRequestFactoryInterface } from '@networking/NetworkRequestFactory'
import { PublishResponse } from "@networking/PublishResponse"
import { PublishResponse } from '@networking/PublishResponse'
import { FrontmatterServiceInterface } from '@services/FrontmatterService'

/*
Expand Down Expand Up @@ -106,7 +106,7 @@ export class PublishPageViewModel {
}

public get missingTitleText(): string {
return this.hasValidTitle ? "" : "Title is mandatory"
return this.hasValidTitle ? '' : 'Title is mandatory'
}

public async publishPage() {
Expand Down
4 changes: 2 additions & 2 deletions src/views/PublishPostViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class PublishPostViewModel implements TagSuggestionDelegate {
}

public get invalidDateText(): string {
return this.isValidDate ? "" : "Invalid date format"
return this.isValidDate ? '' : 'Invalid date format'
}

public async publishNote() {
Expand All @@ -156,7 +156,7 @@ export class PublishPostViewModel implements TagSuggestionDelegate {
const response = this.networkRequestFactory.makePublishPostRequest(
this.title,
this.content,
this.tags.split(","),
this.tags.split(','),
this.visibility,
this.selectedBlogID,
this.formattedScheduledDate()
Expand Down
2 changes: 1 addition & 1 deletion src/views/UpdatePageViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export class UpdatePageViewModel {
}

public get missingTitleText(): string {
return this.hasValidTitle ? "" : "Title is mandatory"
return this.hasValidTitle ? '' : 'Title is mandatory'
}

// Private
Expand Down

0 comments on commit ed083be

Please sign in to comment.