Skip to content

Commit

Permalink
fix: update to use starttransition again
Browse files Browse the repository at this point in the history
  • Loading branch information
0xcadams committed Mar 8, 2024
1 parent ed23fb4 commit 527a609
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions apps/lvpr-tv/src/components/player/Clip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import { createClip } from "./actions";
export function Clip({ className }: { className?: string }) {
const [isPending, startTransition] = useTransition();

const createClipComposed = useCallback(async (opts: ClipPayload) => {
const result = await createClip(opts);
const createClipComposed = useCallback((opts: ClipPayload) => {
startTransition(async () => {
const result = await createClip(opts);

startTransition(() => {
if (result.success) {
toast.success(
<span>
Expand Down
5 changes: 2 additions & 3 deletions examples/next/src/app/player/[type]/Clip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ export function Clip({ className }: { className?: string }) {
const [isPending, startTransition] = useTransition();

const createClipComposed = useCallback(async (opts: ClipPayload) => {
const result = await createClip(opts);

startTransition(() => {
startTransition(async () => {
const result = await createClip(opts);
if (result.success) {
toast.success(
<span>
Expand Down
2 changes: 1 addition & 1 deletion examples/with-pubnub/src/app/create-livestream-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function CreateLivestreamButton({ className }: { className?: string }) {
>
<button
type="submit"
className="items-center rounded-md px-3 py-1 outline outline-1 outline-white/30 hover:outline-white/40 justify-center md:justify-end gap-2 flex-1 flex text-lg text-white/90 transition-opacity"
className="items-center cursor-pointer rounded-md px-3 py-1 outline outline-1 outline-white/30 hover:outline-white/40 justify-center md:justify-end gap-2 flex-1 flex text-lg text-white/90 transition-opacity"
>
<span>Create a livestream</span>
<Videotape strokeWidth={1} className="w-5 h-5" />
Expand Down
4 changes: 2 additions & 2 deletions examples/with-pubnub/src/components/player/Clip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export function Clip({ className }: { className?: string }) {
const [isPending, startTransition] = useTransition();

const createClipComposed = useCallback(async (opts: ClipPayload) => {
const result = await createClip(opts);
startTransition(async () => {
const result = await createClip(opts);

startTransition(() => {
if (result.success) {
toast.success("Clip created!");
} else {
Expand Down

0 comments on commit 527a609

Please sign in to comment.