File tree Expand file tree Collapse file tree 1 file changed +18
-10
lines changed
apps/client/src/code/pages Expand file tree Collapse file tree 1 file changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -232,19 +232,27 @@ export class Pages {
232232 }
233233
234234 async goBackward ( ) {
235- await this . goToPage (
236- this . react . pathPageIds [
237- this . react . pathPageIds . indexOf ( this . react . pageId ! ) - 1
238- ] ,
239- ) ;
235+ const pageIndex = this . react . pathPageIds . indexOf ( this . react . pageId ! ) ;
236+
237+ if ( pageIndex > 0 ) {
238+ await this . goToPage (
239+ this . react . pathPageIds [
240+ this . react . pathPageIds . indexOf ( this . react . pageId ! ) - 1
241+ ] ,
242+ ) ;
243+ }
240244 }
241245
242246 async goForward ( ) {
243- await this . goToPage (
244- this . react . pathPageIds [
245- this . react . pathPageIds . indexOf ( this . react . pageId ! ) + 1
246- ] ,
247- ) ;
247+ const pageIndex = this . react . pathPageIds . indexOf ( this . react . pageId ! ) ;
248+
249+ if ( pageIndex < this . react . pathPageIds . length - 1 ) {
250+ await this . goToPage (
251+ this . react . pathPageIds [
252+ this . react . pathPageIds . indexOf ( this . react . pageId ! ) + 1
253+ ] ,
254+ ) ;
255+ }
248256 }
249257
250258 destroy ( ) {
You can’t perform that action at this time.
0 commit comments