mirror of
https://github.com/excalidraw/excalidraw
synced 2025-07-25 13:58:22 +08:00
Update App.tsx
This commit is contained in:
@ -593,6 +593,11 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
* insert to DOM before user initially scrolls to them) */
|
* insert to DOM before user initially scrolls to them) */
|
||||||
private initializedEmbeds = new Set<ExcalidrawIframeLikeElement["id"]>();
|
private initializedEmbeds = new Set<ExcalidrawIframeLikeElement["id"]>();
|
||||||
|
|
||||||
|
private handleToastClose = () => {
|
||||||
|
this.setToast(null);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
private elementsPendingErasure: ElementsPendingErasure = new Set();
|
private elementsPendingErasure: ElementsPendingErasure = new Set();
|
||||||
|
|
||||||
public flowChartCreator: FlowChartCreator = new FlowChartCreator();
|
public flowChartCreator: FlowChartCreator = new FlowChartCreator();
|
||||||
@ -1707,14 +1712,16 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
/>
|
/>
|
||||||
</ElementCanvasButtons>
|
</ElementCanvasButtons>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{this.state.toast !== null && (
|
{this.state.toast !== null && (
|
||||||
<Toast
|
<Toast
|
||||||
message={this.state.toast.message}
|
message={this.state.toast.message}
|
||||||
onClose={() => this.setToast(null)}
|
onClose={this.handleToastClose} // ✅ Stable reference
|
||||||
duration={this.state.toast.duration}
|
duration={this.state.toast.duration}
|
||||||
closable={this.state.toast.closable}
|
closable={this.state.toast.closable}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{this.state.contextMenu && (
|
{this.state.contextMenu && (
|
||||||
<ContextMenu
|
<ContextMenu
|
||||||
items={this.state.contextMenu.items}
|
items={this.state.contextMenu.items}
|
||||||
|
Reference in New Issue
Block a user