Skip to content

Commit

Permalink
web/main: use insertion effect for style injection
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Nov 8, 2024
1 parent 0da7ed1 commit c6992b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/src/ui/MainScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import { use, useEffect, useMemo, useReducer, useState } from "react"
import { use, useEffect, useInsertionEffect, useMemo, useReducer, useState } from "react"
import Client from "@/api/client.ts"
import { RoomStateStore } from "@/api/statestore"
import type { RoomID } from "@/api/types"
Expand Down Expand Up @@ -93,7 +93,7 @@ const MainScreen = () => {
[client],
)
useEffect(() => context.keybindings.listen(), [context])
useEffect(() => {
useInsertionEffect(() => {
const styleTags = document.createElement("style")
styleTags.textContent = `
div.html-body > a.hicli-matrix-uri-user[href="matrix:u/${client.userID.slice(1).replaceAll(`"`, `\\"`)}"] {
Expand Down

0 comments on commit c6992b0

Please sign in to comment.