Skip to content

Commit

Permalink
Typos
Browse files Browse the repository at this point in the history
  • Loading branch information
defnull committed Jun 6, 2024
1 parent 98fd76d commit 1d13a93
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ This project was inspired by [Mastowall](https://github.com/rstockm/mastowall),

## License

Copyright (C) 2023 Marcel Hellkamp
Copyright (C) 2024 Marcel Hellkamp
Copyright (C) 2023 Gesellschaft für wissenschaftliche Datenverarbeitung mbH Göttingen

This program is free software: you can redistribute it and/or modify
Expand Down
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ onUpdated(fixLayout)
watch([useWindowSize().width, config, allPosts], fixLayout, { deep: true })
// Watch for a theme changes
const isDarkPrefered = usePreferredDark()
const isDarkPreferred = usePreferredDark()
const actualTheme = computed(() => {
var theme = config.value?.theme
if (!theme || theme === "auto")
theme = isDarkPrefered.value ? "dark" : "light"
theme = isDarkPreferred.value ? "dark" : "light"
return theme
})
watch(actualTheme, () => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/ConfigModal.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { sanatizeConfig, isServer, isLanguage, toQuery } from '@/config';
import { sanitizeConfig, isServer, isLanguage, toQuery } from '@/config';
import { computed, ref } from 'vue';
import { arrayUnique } from '@/utils';
import { type Config } from '@/types';
Expand All @@ -14,7 +14,7 @@ const props = defineProps<{
const config = computed({
get: () => props.modelValue,
set: (value) => emit('update:modelValue', sanatizeConfig(value)),
set: (value) => emit('update:modelValue', sanitizeConfig(value)),
});
const formServers = computed({
Expand Down Expand Up @@ -251,7 +251,7 @@ const onSubmit = () => {
<input type="text" class="form-control" id="edit-server" placeholder="all languages"
v-model.lazy="formLang">
<div class="form-text">List of <a href="https://en.wikipedia.org/wiki/ISO_639-1"
tyrget="_blanlk">two-letter language codes</a> to allow. Leave blank to allow all languages.</div>
target="_blank">two-letter language codes</a> to allow. Leave blank to allow all languages.</div>
</div>
</div>

Expand Down
8 changes: 4 additions & 4 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export function fromQuery(query: string): Config {
}

// Clean, fix and return a valid config
return sanatizeConfig(config);
return sanitizeConfig(config);
}

export function toQuery(config: Config, userConfig?: string): string {
Expand Down Expand Up @@ -223,7 +223,7 @@ export function isLanguage(lang: string) {
return isString(lang) && lang.match(/^[a-z]{2}$/i)
}

export function sanatizeConfig(config: any): Config {
export function sanitizeConfig(config: any): Config {

const boolOr = (value: any, fallback: boolean) => {
if (typeof value == "boolean") return value;
Expand Down Expand Up @@ -284,7 +284,7 @@ export async function loadConfig() {
try {
const rs = await fetch(url, { cache: "reload", })
if (!rs.ok) throw new Error(`HTTP error! Status: ${rs.status}`);
siteConfig = sanatizeConfig(await rs.json() || {});
siteConfig = sanitizeConfig(await rs.json() || {});
siteConfigSource = url
} catch (e) {
console.warn(`Failed to load (or parse) [${url}], falling back to defaults.`)
Expand All @@ -297,7 +297,7 @@ export async function loadConfig() {
if (!siteConfig && siteConfigUrl)
await loadJson(siteConfigUrl)
if (!siteConfig)
siteConfig = sanatizeConfig(deepClone(fallbackConfig))
siteConfig = sanitizeConfig(deepClone(fallbackConfig))

return fromQuery(window.location.search)
}
4 changes: 2 additions & 2 deletions src/sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export async function fetchPosts(cfg: Config, onProgress: (progress: Progress) =

// Collect results
const posts: Post[] = []
const addOrRepacePost = (post: Post) => {
const addOrReplacePost = (post: Post) => {
const i = posts.findIndex(p => p.id === post.id)
if (i >= 0)
posts[i] = post
Expand All @@ -108,7 +108,7 @@ export async function fetchPosts(cfg: Config, onProgress: (progress: Progress) =
.map(status => fixLocalAcct(domain, status))
.filter(status => filterStatus(cfg, status))
.map(status => statusToWallPost(cfg, status))
.forEach(addOrRepacePost)
.forEach(addOrReplacePost)
} catch (err: any) {
let error = err instanceof Error ? err : new Error(err?.toString())
progress.errors.push(error)
Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ export function deepClone(obj: any) {


/**
* Find all text nodes and replace each occuences of a pattern with either
* Find all text nodes and replace each occurrences of a pattern with either
* a string or a new DOM node. Can be used to replace emojis with images or
* URLs with links.
*
* The root node is modifed in-place and also returned.
* The root node is modified in-place and also returned.
*/
export function replaceInText(root: Node, pattern: RegExp, replace: (m: RegExpMatchArray) => string | Node) {
const walk = (node: Node) => {
Expand Down

0 comments on commit 1d13a93

Please sign in to comment.