Skip to content

Commit 2256777

Browse files
olzzonjstarpl
authored andcommitted
fix: go to renderDataMissing() is rundown is not found - and revert previous implentation
1 parent b5eefc2 commit 2256777

File tree

3 files changed

+2
-35
lines changed

3 files changed

+2
-35
lines changed

meteor/client/lib/ReactMeteorData/ReactMeteorData.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ export function useSubscription<K extends keyof AllPubSubTypes>(
402402
/**
403403
* A Meteor Subscription hook that allows using React Functional Components and the Hooks API with Meteor subscriptions.
404404
* Subscriptions will be torn down 1000ms after unmounting the component.
405+
* If the subscription is not enabled, the subscription will not be created, and the ready state will always be true.
405406
*
406407
* @export
407408
* @param {PubSub} sub The subscription to be subscribed to
@@ -418,7 +419,6 @@ export function useSubscriptionIfEnabled<K extends keyof AllPubSubTypes>(
418419

419420
useEffect(() => {
420421
if (!enable) {
421-
setReady(false)
422422
return
423423
}
424424

@@ -432,7 +432,7 @@ export function useSubscriptionIfEnabled<K extends keyof AllPubSubTypes>(
432432
}
433433
}, [sub, enable, stringifyObjects(args)])
434434

435-
return ready
435+
return !enable || ready
436436
}
437437

438438
/**

meteor/client/styles/rundownView.scss

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3256,21 +3256,6 @@ svg.icon {
32563256
left: 50%;
32573257
transform: translate(-150%, -50%);
32583258
}
3259-
3260-
> .rundown-view__label {
3261-
position: absolute;
3262-
top: 60%;
3263-
left: 1%;
3264-
right: 0;
3265-
text-align: center;
3266-
font-size: 3em;
3267-
transform: translateY(-50%);
3268-
3269-
> p {
3270-
margin: 20px auto;
3271-
max-width: 1200px;
3272-
}
3273-
}
32743259
}
32753260

32763261
.rundown-view {

meteor/client/ui/RundownView.tsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3257,27 +3257,9 @@ const RundownViewContent = translateWithTracker<IPropsWithReady, IState, ITracke
32573257
}
32583258

32593259
render(): JSX.Element {
3260-
const { t } = this.props
32613260
if (!this.props.subsReady) {
32623261
return (
32633262
<div className="rundown-view rundown-view--loading">
3264-
<div className="rundown-view__label">
3265-
<p>
3266-
<Route
3267-
render={({ history }) => (
3268-
<button
3269-
className="btn btn-primary"
3270-
onClick={() => {
3271-
history.push('/rundowns')
3272-
}}
3273-
>
3274-
{t('Return to list')}
3275-
</button>
3276-
)}
3277-
/>
3278-
</p>
3279-
</div>
3280-
32813263
<Spinner />
32823264
</div>
32833265
)

0 commit comments

Comments
 (0)