Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
fix #844
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuki committed Feb 14, 2023
1 parent af6a050 commit 4d77bf0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/js/login/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ async function login(url: string) {
website: 'https://thedesk.top',
},
})
const auth = `https://${url}/oauth/authorize?client_id=${json.client_id}&client_secret=${json.client_secret}&response_type=code&scope=read+write+follow&redirect_uri=${encodeURIComponent(red)}`
const auth = `https://${url}/oauth/authorize?client_id=${json.client_id}&client_secret=${json.client_secret}&response_type=code&scope=read+write+follow&redirect_uri=${encodeURIComponent(red)}&state=thedesk`
localStorage.setItem('domain_tmp', url)
localStorage.setItem('client_id', json.client_id)
localStorage.setItem('client_secret', json.client_secret)
Expand Down
5 changes: 4 additions & 1 deletion app/js/tl/baseStreaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { notfCommon } from './notification'
import { parse } from './parse'
import { say } from './speech'
import { isTagData } from './tag'
import { announ } from './tl'
import { announ, tlCloser } from './tl'
import { userParse } from './userParse'
import $ from 'jquery'
import Swal from 'sweetalert2'
Expand Down Expand Up @@ -62,6 +62,7 @@ export function mastodonBaseStreaming(acctId: string) {
const tl = JSON.parse(mess.data).stream
const obj: Toot = JSON.parse(JSON.parse(mess.data).payload)
const tls = getTlMeta(tl[0], tl, acctId, obj)
console.log(`on message for`, tls)
insertTl(obj, tls)
} else if (typeA === 'filters_changed') {
filterUpdate(acctId)
Expand Down Expand Up @@ -178,6 +179,8 @@ function insertTl(obj: Toot, tls: TLMeta[], dry?: boolean) {
const templateRaw = parse([obj], type, acctId.toString(), id.toString(), 0, mute)
const template = typeof templateRaw === 'string' ? templateRaw : templateRaw[0]
return template
} else {
console.error('Error of inserting TL', tls, obj.id)
}
}
}
Expand Down
1 change: 0 additions & 1 deletion app/js/tl/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export function parse<T = string | string[]>(obj: Toot[], type: IColumnType | 'p
const uniqueid = toot.id
let boostback: IBoostBack = 'unshared'
let disName = escapeHTML(toot.account.display_name || toot.account.acct)

if (toot.reblog) {
disName = escapeHTML(toot.account.display_name || toot.account.acct)
//絵文字があれば
Expand Down
2 changes: 1 addition & 1 deletion app/js/ui/sort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function sort() {
$('#sort').html('')
toast({ html: 'Sorted', displayLength: 3000 })
sortLoad()
parseColumn()
parseColumn(undefined, true)
sortMenu()
}
//ソートボタントグル
Expand Down
7 changes: 4 additions & 3 deletions app/js/userdata/showOnTL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export async function udg(user: string | undefined, acctId: string, isSwal?: boo
fer(json.id, '', acctId)
let disName = twemojiParse(escapeHTML(json.display_name || json.acct))
disName = customEmojiReplace(disName, json, gif)
let note = json.note
let note = json.note || ''
note = customEmojiReplace(note, json, gif)
$('#his-name').html(disName)
$('#his-acct').text(json.acct)
Expand All @@ -108,7 +108,7 @@ export async function udg(user: string | undefined, acctId: string, isSwal?: boo
$('#his-follower').text(flerc)
$('#his-since').text(crat(json.created_at))
$('#his-openin').attr('data-href', json.url)
if (json.fields) {
if (json.fields && json.fileds?.length) {
let table = ''
if (json.fields.length > 0) {
$('#his-des').css('max-height', '115px')
Expand Down Expand Up @@ -145,6 +145,7 @@ export async function udg(user: string | undefined, acctId: string, isSwal?: boo
$('#his-float-timeline').css('height', $('#his-data-show').height() + 'px')
localStorage.setItem('history', user)
//自分の時
console.log(json.acct + localStorage.getItem('user_' + acctId))
if (json.acct === localStorage.getItem('user_' + acctId)) {
showFav('', acctId)
showBlo('', acctId)
Expand All @@ -161,7 +162,7 @@ export async function udg(user: string | undefined, acctId: string, isSwal?: boo
i++
}
}
let des = json.note
let des = json.note || ''
des = des.replace(/<br \/>/g, '\n')
des = stripTags(des)
$('#his-des-val').val(des)
Expand Down

0 comments on commit 4d77bf0

Please sign in to comment.