chore: Revert reset main canvas reducer (#40406)

## Description

[Thread](https://theappsmith.slack.com/archives/CGBPVEJ5C/p1745816357424529)

Revert from
https://github.com/appsmithorg/appsmith/pull/40349/files#diff-81c17163a9b2e20b963396864fc8106e02d812add8ddc82bf9e4f4bffeb273edR42


Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags="@tag.All"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/14701911027>
> Commit: 86fc8d8465e64d9b903cec2ccae9fe960e42b526
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=14701911027&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Mon, 28 Apr 2025 08:06:57 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Refactor**
- Improved internal handling of the editor reset action for enhanced
maintainability. No impact on user-facing features.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Ashit Rath 2025-04-28 13:38:38 +05:30 committed by GitHub
parent d64087f366
commit 007ada81f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,7 +7,6 @@ import {
} from "constants/WidgetConstants";
import type { UpdateCanvasLayoutPayload } from "actions/controlActions";
import type { UpdateCanvasPayload } from "actions/pageActions";
import { klona } from "klona";
export const initialState: MainCanvasReduxState = {
initialized: false,
@ -39,9 +38,6 @@ export const handlers = {
state.isMobile =
action.payload.width <= layoutConfigurations.MOBILE.maxWidth;
},
[ReduxActionTypes.RESET_EDITOR_REQUEST]: () => {
return klona(initialState);
},
};
const mainCanvasReducer = createImmerReducer(initialState, handlers);